Skip to content

Commit a3a95d7

Browse files
committed
bugfix ArangoDatabase.route() path escaping
1 parent 87f658e commit a3a95d7

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/main/java/com/arangodb/async/internal/ArangoDatabaseAsyncImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ public CompletableFuture<Void> reloadRouting() {
399399

400400
@Override
401401
public ArangoRouteAsync route(final String... path) {
402-
return new ArangoRouteAsyncImpl(this, createPath(path), Collections.emptyMap());
402+
return new ArangoRouteAsyncImpl(this, String.join("/", path), Collections.emptyMap());
403403
}
404404

405405
@Override

src/main/java/com/arangodb/async/internal/ArangoRouteAsyncImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ public class ArangoRouteAsyncImpl
4242

4343
@Override
4444
public ArangoRouteAsync route(final String... path) {
45-
return new ArangoRouteAsyncImpl(db, createPath(this.path, createPath(path)), headerParam);
45+
final String[] fullPath = new String[path.length + 1];
46+
fullPath[0] = this.path;
47+
System.arraycopy(path, 0, fullPath, 1, path.length);
48+
return new ArangoRouteAsyncImpl(db, String.join("/", fullPath), headerParam);
4649
}
4750

4851
@Override

src/main/java/com/arangodb/internal/ArangoDatabaseImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ protected ArangoDatabaseImpl setCursorInitializer(final ArangoCursorInitializer
395395

396396
@Override
397397
public ArangoRoute route(final String... path) {
398-
return new ArangoRouteImpl(this, createPath(path), Collections.emptyMap());
398+
return new ArangoRouteImpl(this, String.join("/", path), Collections.emptyMap());
399399
}
400400

401401
@Override

src/main/java/com/arangodb/internal/ArangoRouteImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ protected ArangoRouteImpl(final ArangoDatabaseImpl db, final String path, final
3939

4040
@Override
4141
public ArangoRoute route(final String... path) {
42-
return new ArangoRouteImpl(db, createPath(this.path, createPath(path)), headerParam);
42+
final String[] fullPath = new String[path.length + 1];
43+
fullPath[0] = this.path;
44+
System.arraycopy(path, 0, fullPath, 1, path.length);
45+
return new ArangoRouteImpl(db, String.join("/", fullPath), headerParam);
4346
}
4447

4548
@Override

0 commit comments

Comments
 (0)