mirror of https://gitlab.com/bashrc2/epicyon
Consolidation of Accept within signed GET
parent
6cef4923de
commit
a3328b33bb
|
@ -907,6 +907,11 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
def _hasAccept(self, callingDomain: str) -> bool:
|
def _hasAccept(self, callingDomain: str) -> bool:
|
||||||
"""Do the http headers have an Accept field?
|
"""Do the http headers have an Accept field?
|
||||||
"""
|
"""
|
||||||
|
if not self.headers.get('Accept'):
|
||||||
|
if self.headers.get('accept'):
|
||||||
|
print('Upper case Accept')
|
||||||
|
self.headers['Accept'] = self.headers['accept']
|
||||||
|
|
||||||
if self.headers.get('Accept') or callingDomain.endswith('.b32.i2p'):
|
if self.headers.get('Accept') or callingDomain.endswith('.b32.i2p'):
|
||||||
if not self.headers.get('Accept'):
|
if not self.headers.get('Accept'):
|
||||||
self.headers['Accept'] = \
|
self.headers['Accept'] = \
|
||||||
|
|
|
@ -191,6 +191,10 @@ def _getJsonSigned(session, url: str, domainFull: str, sessionHeaders: {},
|
||||||
if key == 'Accept' or key == 'User-Agent':
|
if key == 'Accept' or key == 'User-Agent':
|
||||||
continue
|
continue
|
||||||
sessionHeaders[key] = value
|
sessionHeaders[key] = value
|
||||||
|
# avoid double accept
|
||||||
|
if sessionHeaders.get('Accept') and sessionHeaders.get('accept'):
|
||||||
|
del sessionHeaders['Accept']
|
||||||
|
sessionHeaders['Origin'] = domainFull
|
||||||
print('Signed GET sessionHeaders ' + str(sessionHeaders))
|
print('Signed GET sessionHeaders ' + str(sessionHeaders))
|
||||||
|
|
||||||
return _getJsonRequest(session, url, domainFull, sessionHeaders,
|
return _getJsonRequest(session, url, domainFull, sessionHeaders,
|
||||||
|
|
Loading…
Reference in New Issue