Permalink
Browse files

tproxy: implement rfc6585 s6

  • Loading branch information...
1 parent 0616aae commit cf0ec54b79cbb15a67300c430da6efaf6e6b3119 @micolous committed Dec 30, 2012
Showing with 19 additions and 2 deletions.
  1. +19 −2 tollgate/captive_landing/tproxy.py
@@ -40,9 +40,9 @@ def finish_request(self, request, client_address):
class TProxyRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
url = self.server.redirect % quote('http://' + self.headers['Host'] + self.path)
- self.send_response(302, 'Captive Portal Login Required')
+ self.send_response(511, 'Network Authentication Required')
self.send_header('Content-Type', 'text/html')
- self.send_header('Location', url)
+ #self.send_header('Location', url)
self.send_header('Last-Modified', 'Thu, 01 Jan 1970 03:13:37 GMT')
self.send_header('Expires', 'Thu, 01 Jan 1970 03:13:37 GMT')
self.send_header('Pragma', 'no-cache')
@@ -55,6 +55,23 @@ def do_GET(self):
<head>
<title>Captive Portal Logon Required</title>
<meta http-equiv="refresh" content="0;URL=%(url)s">
+ <!--
+
+ Prevent certain popular Microsoft UAs from hiding our "error" page.
+
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
+ -->
</head>
<body>

0 comments on commit cf0ec54

Please sign in to comment.