httpbin_secure: fix redirect Location to have "https://" scheme#62
Conversation
|
@kevin1024 please let me know if there's anything i can do to help get this in |
|
Thanks for the ping! Hopefully I’ll have some time over the holidays to figure out how to do a release again |
|
The test from this PR is failing when we try to build pytest-httpbin 1.0.2 for Fedora, and I'm not sure why. It fails like this: which I think is telling us that the string it expects to start with "https://" is actually just "/html". But I'm not sure why that would be. We don't patch pytest-httpbin at all, our build is straight from the tarball. We have backported a couple of patches for httpbin itself - postmanlabs/httpbin#649 and postmanlabs/httpbin#555 - but I don't think either of those should affect this. Any ideas? |
|
OK, so now I think I know why. This PR is actually written against broken httpbin behaviour, see postmanlabs/httpbin#647 and postmanlabs/httpbin#673 . httpbin intends to tell werkzeug not to rewrite the I am patching httpbin in Fedora downstream to fix this problem, so our httpbin behaves as it's intended to, which results in this test failing. I guess the fix might just be to set |
|
ugh, doesn't look like we can just import |
This PR fixes the problem with secure server that had a missing feature in the part where HTTPS connection was terminated: it was not setting
HTTPSWSGI environment variable as required by wsgiref.util.guess_scheme. As a result, the server when trying to autogenerate an absolute URL forLocationheader would end up with something like:That would result in an error down the road with some HTTP clients, e.g.
requests, where it would try to follow a redirect opening a plaintext HTTP connection to a port that expected HTTPS and it resulted in the following error:Ultimately, it started breaking CI builds for vcrpy