nahi / httpclient

'httpclient' gives something like the functionality of libwww-perl (LWP) in Ruby.
https://github.com/nahi/httpclient
701 stars 290 forks source link

absolute URIs should not include a port component when the port matches the scheme default #457

Open mattbnz opened 7 months ago

mattbnz commented 7 months ago

In certain circumstances (e.g. proxy configured, HTTP URI being requested), httpclient will enforce the output of an "absolute" URI for the request -

The logic for generating an absolute URI unconditionally includes the port number, even when it matches the default port number of the scheme in the URI. This behaviour is contrary to https://www.rfc-editor.org/rfc/rfc3986#section-3.2.3 which states the port should be omitted when it matches the default.

https://github.com/nahi/httpclient/compare/master...mkmba-nz:httpclient:omit_default_port is an example of a simple patch that fixes this issue and updates httpclient to the RFC-compliant behaviour.

Is there any hope/interest in merging such a PR to this library?

I see there have been no releases for many years, so raising this issue to discuss before spending more time on the PR, I am happy to clean it up and add tests, etc if there would be interest in merging it.