Content-type can contain multiple things

merge-requests/30/head
Bob Mottram 2021-02-09 19:26:41 +00:00
parent 530f573763
commit e74682a0ba
1 changed files with 3 additions and 2 deletions

View File

@ -13537,8 +13537,9 @@ class PubServer(BaseHTTPRequestHandler):
return
# refuse to receive non-json content
if self.headers['Content-type'] != 'application/json' and \
self.headers['Content-type'] != 'application/activity+json':
contentTypeStr = self.headers['Content-type']
if not contentTypeStr.startswith('application/json') and \
not contentTypeStr.startswith('application/activity+json'):
print("POST is not json: " + self.headers['Content-type'])
if self.server.debug:
print(str(self.headers))