Skip to content

Commit 6e6bba8

Browse files
committed
url instead of path
1 parent a81fca6 commit 6e6bba8

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

http-client/src/main/java/io/avaje/http/client/DUrlBuilder.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ final class DUrlBuilder implements UrlBuilder {
1515

1616
@Override
1717
public UrlBuilder url(String url) {
18-
buffer.delete(0, buffer.length());
18+
19+
if (url.startsWith("http") && url.contains("://")) {
20+
buffer.setLength(0);
21+
}
22+
1923
buffer.append(url);
2024
return this;
2125
}
2226

2327
@Override
2428
public UrlBuilder path(String path) {
25-
if (path.startsWith("http") && path.contains("://")) {
26-
return url(path);
27-
}
2829
buffer.append("/").append(path);
2930
return this;
3031
}

http-generator-client/src/main/java/io/avaje/http/generator/client/ClientMethodWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ private void writePaths(Set<PathSegments.Segment> segments) {
382382
continue;
383383
}
384384
if (first) {
385-
writer.append(".path(\"");
385+
writer.append(".url(\"");
386386
first = false;
387387
}
388388
if (noSlash) {

0 commit comments

Comments
 (0)