Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(792)

Unified Diff: net/tools/testserver/testserver.py

Issue 1059303002: Don't process HSTS/HPKP headers when host is an IP address (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ugly workaround for mac 10.6 getaddrinfo bug Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/test/spawned_test_server/base_test_server.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/testserver/testserver.py
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index bda4f9078d96d6bf0a155239c471d0045ecdca55..b7bce97933a391d8ba51b23f05398a7290464c1d 100755
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -1980,6 +1980,14 @@ class ServerRunner(testserver_base.TestServerRunner):
port = self.options.port
host = self.options.host
+ # Work around a bug in Mac OS 10.6. Spawning a WebSockets server
+ # will result in a call to |getaddrinfo|, which fails with "nodename
+ # nor servname provided" for localhost:0 on 10.6.
+ if self.options.server_type == SERVER_WEBSOCKET and \
+ host == "localhost" and \
+ port == 0:
+ host = "127.0.0.1"
+
if self.options.server_type == SERVER_HTTP:
if self.options.https:
pem_cert_and_key = None
@@ -2085,6 +2093,8 @@ class ServerRunner(testserver_base.TestServerRunner):
'specified trusted client CA file not found: ' +
self.options.ssl_client_ca[0] + ' exiting...')
websocket_options.tls_client_ca = self.options.ssl_client_ca[0]
+ print 'Trying to start websocket server on %s://%s:%d...' % \
+ (scheme, websocket_options.server_host, websocket_options.port)
server = WebSocketServer(websocket_options)
print 'WebSocket server started on %s://%s:%d...' % \
(scheme, host, server.server_port)
« no previous file with comments | « net/test/spawned_test_server/base_test_server.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698