Rocket icon indicating copy to clipboard operation
Rocket copied to clipboard

Fix Request::client_ip for TLS connections

Open palant opened this issue 4 months ago • 2 comments

Request::client_ip method currently always returns None on TLS connections if no “real ip” header is configured/present, a regression compared to Rocket 0.5. That’s because the fallback assumes Request::remote to return a TCP endpoint and won’t handle TLS endpoints correctly.

I considered changing Endpoint::tcp (and Endpoint::unix) method to automatically recurse for TLS endpoints instead but I doubt this is how the code logic there is supposed to be.

palant avatar Feb 20 '24 12:02 palant