Skip to content

Commit ad7aa81

Browse files
committed
fix exceptions on PutCompareExchangeValueOperation
This commit adds the support for encoding the key property of PutCompareExchangeValueOperation, thus allowing it to be used with special characters which would break the URL otherwise. This function is already used on all other operations, like GetCompareExchange so it's safe to use in here too.
1 parent 3233120 commit ad7aa81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Documents/Operations/CompareExchange/PutCompareExchangeValueOperation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class PutCompareExchangeValueCommand<T> extends RavenCommand<CompareExcha
7272
}
7373

7474
public createRequest(node: ServerNode): HttpRequestParameters {
75-
const uri = node.url + "/databases/" + node.database + "/cmpxchg?key=" + this._key + "&index=" + this._index;
75+
const uri = node.url + "/databases/" + node.database + "/cmpxchg?key=" + encodeURIComponent(this._key) + "&index=" + this._index;
7676

7777
const tuple = {};
7878
tuple["Object"] = TypeUtil.isPrimitive(this._value)

0 commit comments

Comments
 (0)