mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-28 05:51:16 -05:00
Set SERVER_NAME and SERVER_PORT
This commit is contained in:
parent
ffb2e8488f
commit
e1b2d8f26e
@ -188,8 +188,6 @@ class SupyHTTPRequestHandler(BaseHTTPRequestHandler):
|
|||||||
# WSGI-based callback
|
# WSGI-based callback
|
||||||
environ = WSGIRequestHandler.get_environ(self)
|
environ = WSGIRequestHandler.get_environ(self)
|
||||||
environ.update({
|
environ.update({
|
||||||
'SERVER_NAME': '0.0.0.0', # TODO
|
|
||||||
'SERVER_PORT': '80', # TODO
|
|
||||||
'PATH_INFO': '/' + environ['PATH_INFO'].split('/', 2)[2]
|
'PATH_INFO': '/' + environ['PATH_INFO'].split('/', 2)[2]
|
||||||
})
|
})
|
||||||
SimpleHandler(
|
SimpleHandler(
|
||||||
@ -440,9 +438,6 @@ class RealSupyHTTPServer(HTTPServer):
|
|||||||
timeout = 0.5
|
timeout = 0.5
|
||||||
running = False
|
running = False
|
||||||
|
|
||||||
|
|
||||||
base_environ = {}
|
|
||||||
|
|
||||||
def __init__(self, address, protocol, callback):
|
def __init__(self, address, protocol, callback):
|
||||||
self.protocol = protocol
|
self.protocol = protocol
|
||||||
if protocol == 4:
|
if protocol == 4:
|
||||||
@ -451,7 +446,15 @@ class RealSupyHTTPServer(HTTPServer):
|
|||||||
self.address_family = socket.AF_INET6
|
self.address_family = socket.AF_INET6
|
||||||
else:
|
else:
|
||||||
raise AssertionError(protocol)
|
raise AssertionError(protocol)
|
||||||
|
|
||||||
HTTPServer.__init__(self, address, callback)
|
HTTPServer.__init__(self, address, callback)
|
||||||
|
|
||||||
|
host, port = self.server_address[:2]
|
||||||
|
self.base_environ = {
|
||||||
|
'SERVER_NAME': socket.getfqdn(host),
|
||||||
|
'SERVER_PORT': str(port),
|
||||||
|
}
|
||||||
|
|
||||||
self.callbacks = DEFAULT_CALLBACKS.copy()
|
self.callbacks = DEFAULT_CALLBACKS.copy()
|
||||||
|
|
||||||
def server_bind(self):
|
def server_bind(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user