Skip to content

Additional trailing slash after migration on 10.x version #887

@romnovi

Description

@romnovi

After migration from 9.x to 10.x version feign adds slash between path and query.
Please take a look at my code:

public interface AbsInterface {
    @RequestLine("GET")
    Response absRequest(URI url);
}
public okhttp3.OkHttpClient createOkHttp3Client() {
    okhttp3.OkHttpClient.Builder builder = new okhttp3.OkHttpClient.Builder();
    builder.addInterceptor(new RedirectInterceptor());
    builder.readTimeout(TIMEOUT_MINUTES, TimeUnit.MINUTES);
    builder.writeTimeout(TIMEOUT_MINUTES, TimeUnit.MINUTES);
    return builder.build();
}
AbsInterface absInterface = Feign.builder()
                .client(new OkHttpClient(createOkHttp3Client()))
                .logLevel(Logger.Level.FULL)
                .target(Target.EmptyTarget.create(AbsInterface.class));

absInterface.absRequest(new URI("http://localhost:8080/path?query=test"));
// produces http://localhost:8080/path/?query=test request

You can see additional slash appeared between path and query. I found out there's big refactoring of https://github.com/OpenFeign/feign/blob/2ba96239dc48e5906702491a027263cf631df092/core/src/main/java/feign/RequestTemplate.java, pay attention on the path() method

Metadata

Metadata

Assignees

Labels

bugUnexpected or incorrect behaviorregressionBugs and issues related to unintended breaking changes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions