Receiving POST from lynx

main
Bob Mottram 2022-07-10 18:36:37 +01:00
parent 00203624f5
commit f32d31464a
1 changed files with 40 additions and 33 deletions

View File

@ -4918,6 +4918,7 @@ class PubServer(BaseHTTPRequestHandler):
users_path = users_path.split('/tags/')[0]
actor_str = self._get_instance_url(calling_domain) + users_path
tag_screen_str = actor_str + '/tags/' + hashtag
boundary = None
if ' boundary=' in self.headers['Content-type']:
boundary = self.headers['Content-type'].split('boundary=')[1]
if ';' in boundary:
@ -4937,6 +4938,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.postreq_busy = False
return
if self.headers.get('Content-length'):
length = int(self.headers['Content-length'])
# check that the POST isn't too large
@ -4967,6 +4969,11 @@ class PubServer(BaseHTTPRequestHandler):
self.server.postreq_busy = False
return
if not boundary:
if b'--LYNX' in post_bytes:
boundary = '--LYNX'
if boundary:
# extract all of the text fields into a dict
fields = \
extract_text_fields_in_post(post_bytes, boundary, debug)