-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Avoid triggering local network privacy prompt on macOS #53368
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
Avoid triggering local network privacy prompt on macOS #53368
Conversation
This makes it possible to run all the Python tests on macOS without triggering the local network privacy prompt, and makes it possible to run wptrunner against at least Chrome, Firefox, and Safari with bind_address=True (the default configuration) without triggering that prompt.
socketserver.TCPServer.server_bind(self) | ||
host, port = self.server_address[:2] | ||
if ( | ||
ipaddress.ip_address(host).is_loopback and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't thins error if host
isn't an IP address?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, self.server_address
is set to Socket.getsockname()
in the superclass, which will give an IP address (for AF_INET and AF_INET6). But maybe that's too much relying on an implementation detail. Could look at self.socket.getsockname()
ourselves, I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I hadn't noticed that TCPServer.sever_bind
was mutating the value of server_address
. I think that makes this fine; I'm not too worried about the stdlib changing.
socketserver.TCPServer.server_bind(self) | ||
host, port = self.server_address[:2] | ||
if ( | ||
ipaddress.ip_address(host).is_loopback and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I hadn't noticed that TCPServer.sever_bind
was mutating the value of server_address
. I think that makes this fine; I'm not too worried about the stdlib changing.
This makes it possible to run all the Python tests on macOS without triggering the local network privacy prompt, and makes it possible to run wptrunner against at least Chrome, Firefox, and Safari with
bind_address=True
(the default configuration) without triggering that prompt.