Consolidation of Accept within signed GET

main
Bob Mottram 2021-08-31 22:57:49 +01:00
parent 6cef4923de
commit a3328b33bb
2 changed files with 9 additions and 0 deletions

View File

@ -907,6 +907,11 @@ class PubServer(BaseHTTPRequestHandler):
def _hasAccept(self, callingDomain: str) -> bool:
"""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 not self.headers.get('Accept'):
self.headers['Accept'] = \

View File

@ -191,6 +191,10 @@ def _getJsonSigned(session, url: str, domainFull: str, sessionHeaders: {},
if key == 'Accept' or key == 'User-Agent':
continue
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))
return _getJsonRequest(session, url, domainFull, sessionHeaders,