Replacing PHP with equivalent Python CGI scripts
Created attachment 426136 [details] Patch
Created attachment 426145 [details] Patch
rdar://76727052
Created attachment 426237 [details] Patch
Created attachment 426448 [details] Patch
Comment on attachment 426448 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426448&action=review > LayoutTests/http/tests/resources/last-modified.py:8 > +date = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('date', [datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')])[0] Python will not send the 'Last-Modified' header if it is empty or an invalid date format. Adding this as the default protects against an empty date
(In reply to Chris Gambrell from comment #6) > Comment on attachment 426448 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=426448&action=review > > > LayoutTests/http/tests/resources/last-modified.py:8 > > +date = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('date', [datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')])[0] > > Python will not send the 'Last-Modified' header if it is empty or an invalid > date format. Adding this as the default protects against an empty date More accurately, Apache will not send the Last-Modified header if Python prints an empty or invalid header.
Created attachment 426496 [details] Patch
Comment on attachment 426496 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426496&action=review > LayoutTests/http/tests/misc/last-modified-parsing.html:17 > +test('Mon, 03 Mar 2008 01:03:33 GMT'); ...which port was this required to fix? Looking at the test name, I think we're meaningfully changing the behavior of this test. > LayoutTests/http/tests/resources/portabilityLayer.py:82 > +def set_state(file, state): This has big implications for all of this function's callers. What motivated the change? > LayoutTests/http/tests/resources/reset-temp-file.py:7 > +filename = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('filename', ['404.txt'])[0] Why did we change the name of the default file? > LayoutTests/http/tests/resources/touch-temp-file.py:8 > +filename = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('filename', ['404.txt'])[0] Why did we change the name of the default file?
Created attachment 426573 [details] Patch
Comment on attachment 426573 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426573&action=review > LayoutTests/http/tests/misc/last-modified-parsing.html:8 > + document.write('<iframe src="../resources/last-modified.py?date=' + escape(text) + '"></iframe>'); Reverted to keep different formats of dates in this test > LayoutTests/http/tests/resources/last-modified.py:14 > +else: Re-format date if it isn't in an appropriate format for Last-Modified header. > LayoutTests/http/tests/resources/portabilityLayer.py:82 > +def set_state(file, state): Moved file to first arg to keep consistent with all other functions in this script. Addressed every instance of a caller of this function and made sure they were all changed to match the argument order.
Created attachment 426813 [details] Patch
http/tests/images/mp4-partial-load.html is failing mac-wk2-stress. When running the same test with its PHP version instead of Python, it is failing the same way. There is a separate issue with this test and a separate bug will be created to fix it.
Committed r276602 (237034@main): <https://commits.webkit.org/237034@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 426813 [details].