Skip to content

Commit 4bff82b

Browse files
committed
RDBC-947 Fix query string formatting in SingleNodeBatchCommand methods:
- Remove trailing `?` from URI construction. - Adjust default options to start with `?` when present. - Ensure consistency in query string handling logic.
1 parent f6a2235 commit 4bff82b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Documents/Commands/Batches/SingleNodeBatchCommand.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class SingleNodeBatchCommand extends RavenCommand<BatchCommandResult> imp
101101
}
102102

103103
public createRequest(node: ServerNode): HttpRequestParameters {
104-
const uri = node.url + "/databases/" + node.database + "/bulk_docs?";
104+
const uri = node.url + "/databases/" + node.database + "/bulk_docs";
105105
const headers = HeadersBuilder.create().typeAppJson().build();
106106

107107
if (TypeUtil.isNullOrUndefined(this._supportsAtomicWrites)) {
@@ -172,15 +172,15 @@ export class SingleNodeBatchCommand extends RavenCommand<BatchCommandResult> imp
172172

173173
protected _appendOptions(): string {
174174
if (!this._options) {
175-
return "";
175+
return "?";
176176
}
177177

178178
return SingleNodeBatchCommand.appendOptions(this._options.indexOptions, this._options.replicationOptions, this._options.shardedOptions);
179179

180180
}
181181

182182
protected static appendOptions(indexOptions: IndexBatchOptions, replicationOptions: ReplicationBatchOptions, shardedOptions: ShardedBatchOptions): string {
183-
let result = "";
183+
let result = "?";
184184

185185
if (replicationOptions) {
186186
result += `&waitForReplicasTimeout=${TimeUtil.millisToTimeSpan(replicationOptions.timeout)}`;

0 commit comments

Comments
 (0)