Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 localhost doesn't seem to be included with the defintion of localhost. #639

Open
dragonpaw opened this issue Apr 15, 2022 · 2 comments

Comments

@dragonpaw
Copy link

When I'm trying to allow Redis localhost connections, I have to manually add "::1" to the list of allowed hosts, despite ignore_localhost

@Terseus
Copy link
Contributor

Terseus commented Nov 1, 2022

Ok I've really, really tried to fix this but I hit a wall in the process: Python HTTPServer doesn't support IPv6.

The tests at test_ignore.py uses a httpbin server created with pytest-httpbin which in turn creates a web server using HTTPServer, unfortunately HTTPServer creates the socket internally and we cannot easily manipulate it.

A feasible solution would be to create another fixture in pytest-httpbin (e.g. httpbin_ipv6) which listens on "::1" instead of "127.0.0.1" but HTTPServer have the protocol hardcoded (see here), maybe we can just change that property and it works.

Given that the workaround is as easy as adding "::1" to ignore_hosts I'm not sure it's worth the effort.

I'll left here the branch with the fix implemented, in case someone wants to continue where I left it.

@dragonpaw
Copy link
Author

Thank you for looking into this. You may be right that just adding ::1 is the simplest workaround. (And probably add a note to the documentation to this effect, as it might not be obvious to others who hit this issue.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants