How to include port in HTTP Host header?

0 votes
asked Jan 18 by ducakar (120 points)

When sending an HTTP request created with Rebex.Net.HttpRequestCreator to a URL containing a server port, e.g. http://example.com:8080 the Host header in the resulting HTTP request is
Host: example.com
instead of
Host: example.com:8080
which confuses some web servers, e.g. Zeus always responds with 404. All other HTTP clients I tested (.NET, curl and wget) do include the port.

I wasn't able to find a way to manipulate the Host header in Rebex.

1 Answer

0 votes
answered Jan 18 by Lukas Matyska (52,730 points)

We considered it as bug. The port should be included automatically.

Thank you for letting us know. I will make a hotfix. Do you want to receive it?

...