Skip to content

[馃悰 Bug]: HttpClient breaks URIs due to let's guess what part of the URI needs encoding聽#17994

Description

@joerg1985

Description

#17968 did add a URI encoding which is functional not correct (see example below) and i my mind not useful at all, either a URI has been correctly encoded by the caller or the caller did use the HttpClient incorrect. We should not try to hide this by a let's guess what part of the URI needs encoding approach.

The original issue has been fixed with f3ccc60 so there is no need for this at all.

Will propably raise an PR for this, this is just for documentation or people to stop me (@diemol)

Reproducible Code

// Before PR 17968 the seResponse is also HTTP 200

var seResponse = new JdkHttpClient.Factory().createClient(URI.create("https://www.example.com").toURL())
   .execute(new HttpRequest(HttpMethod.GET, "/#test"));

var jdkResponse = HttpClient.newHttpClient().send(java.net.http.HttpRequest.newBuilder(
   URI.create("https://www.example.com/#test")).build(),
   HttpResponse.BodyHandlers.discarding());

   if (jdkResponse.statusCode() != seResponse.getStatus()) {
      throw new IllegalStateException(jdkResponse.statusCode() + " vs. " + seResponse.getStatus());
}

鈩癸笍 Last known working version: 4.48.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-javaJava BindingsI-defectSomething is not working as intendedI-regressionSomething was working but we "fixed" itOS-windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions