diff --git a/content.py b/content.py index 9caccaf87..cac39bf6a 100644 --- a/content.py +++ b/content.py @@ -1497,7 +1497,7 @@ def extract_text_fields_in_post(post_bytes, boundary: str, debug: bool, ) if debug: print('DEBUG: POST message_fields: ' + str(message_fields)) - lynx_content_type = 'Content-Type: text/plain; charset=utf-8' + lynx_content_type = 'Content-Type: text/plain; charset=utf-8\r\n' # examine each section of the POST, separated by the boundary for fld in message_fields: if fld == '--': diff --git a/tests.py b/tests.py index 7e2524463..0d0831805 100644 --- a/tests.py +++ b/tests.py @@ -5855,9 +5855,9 @@ def _test_extract_text_fields_from_post(): boundary = '--LYNX' form_data = '--LYNX\r\nContent-Disposition: form-data; ' + \ 'name="fieldName"\r\nContent-Type: text/plain; ' + \ - 'charset=utf-8\r\nThis is a lynx test\r\n--LYNX\r\n' + \ + 'charset=utf-8\r\n\r\nThis is a lynx test\r\n--LYNX\r\n' + \ 'Content-Disposition: form-data; name="submitYes"\r\n' + \ - 'Content-Type: text/plain; charset=utf-8\r\nBUTTON\r\n--LYNX--\r\n' + 'Content-Type: text/plain; charset=utf-8\r\n\r\nBUTTON\r\n--LYNX--\r\n' debug = True fields = extract_text_fields_in_post(None, boundary, debug, form_data) print('fields: ' + str(fields))