forked from indymedia/epicyon
Respond to connection requests
parent
0a97317314
commit
9ca20f92f2
|
@ -470,6 +470,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('Error when showing '+str(httpCode))
|
print('Error when showing '+str(httpCode))
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
def _200(self) -> None:
|
||||||
|
self._httpReturnCode(200,'Ok')
|
||||||
|
|
||||||
def _404(self) -> None:
|
def _404(self) -> None:
|
||||||
self._httpReturnCode(404,'Not Found')
|
self._httpReturnCode(404,'Not Found')
|
||||||
|
|
||||||
|
@ -926,6 +929,11 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if self.headers.get('Accept'):
|
if self.headers.get('Accept'):
|
||||||
if self._requestHTTP():
|
if self._requestHTTP():
|
||||||
htmlGET=True
|
htmlGET=True
|
||||||
|
else:
|
||||||
|
if self.headers.get('Connection'):
|
||||||
|
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism
|
||||||
|
print('HTTP Connection request: '+self.headers['Connection'])
|
||||||
|
self._200()
|
||||||
else:
|
else:
|
||||||
print('WARN: No Accept header '+str(self.headers))
|
print('WARN: No Accept header '+str(self.headers))
|
||||||
self._400()
|
self._400()
|
||||||
|
|
Loading…
Reference in New Issue