Repository navigation
Conversation
Before this change, fish config used 0 as its address. However, this isn't a good idea from security point of view, as web service can be accessed from everywhere, and do anything on the account it was ran on. This also deals with firewalls which block the access to 0 even from the host machine itself. It possibly might fix #673, but I'm not sure.
|
👍 For anyone who missed the memo, the discussion rationale for this PR is here. |
|
This breaks fish_config for me. In this test: I see that client_address[0] is ::ffff:127.0.0.1, which is not in the whitelist, so is rejected by verify_request. Not sure what the right fix is. |
|
Grr. |
A subclass of TCPServer was created to deny any non-local connections and to listen using an IPv6 socket.
|
Sorry, that was a dumb mistake of mine. Didn't take v4-mapped addresses into consideration. Fixed it |
There was a problem hiding this comment.
"Note The SocketServer module has been renamed to socketserver in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3."
It would be nice if you could update this pull request and test it with python3 too.
There was a problem hiding this comment.
I don't have Python 3 (OS X) but the code already used SocketServer. If fish_config works with Python 3 now, then it should still work.
There was a problem hiding this comment.
@sisteshwar: socketserver for Python 3 is already imported correctly.
if IS_PY2:
import SimpleHTTPServer
import SocketServer
try:
from urllib.parse import parse_qs
except ImportError:
from cgi import parse_qs
else:
import http.server as SimpleHTTPServer
import socketserver as SocketServer
from urllib.parse import parse_qs|
Works for me with Python 2 and 3. Thanks for the fix! Merged as 44b35f7 |
Right now it only listens on IPv4. Let's take one step into the future ;)