titanium-web-proxy icon indicating copy to clipboard operation
titanium-web-proxy copied to clipboard

custom host being overridden on request

Open FreshRob opened this issue 5 years ago • 2 comments

When setting a custom host on the request by doing the following session.HttpClient.Request.Host = "www.example.com";

or via session.HttpClient.Request.Headers.AddHeader("Host", "www.example.com");

It is being overridden by the request handler https://github.com/justcoding121/Titanium-Web-Proxy/blob/1edcb327f88851a7ae9360741a3826532b8730a7/src/Titanium.Web.Proxy/RequestHandler.cs#L115

Is what I am trying to do correct. Would a pr removing that line be acceptable?

FreshRob avatar Oct 20 '20 21:10 FreshRob

I think the Request.Host setter should update the Request.RequestUri and Request.Url properties, too.

Removing this line is not OK, since then it won't work is a user specified a new URI/URL for the request.

honfika avatar Oct 20 '20 22:10 honfika

I thought not, I will continue to look into it and find a better solution

FreshRob avatar Oct 21 '20 08:10 FreshRob