Skip to content

Commit f103d9f

Browse files
authored
[test] Remove redundant send_head from TestServerHandler. NFC (#23609)
This override doesn't seem to be necessary. The mime type of `.js` files seems to be set just find by the default `send_head`. Split out from #23021
1 parent 4d4633d commit f103d9f

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

test/common.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,24 +2060,6 @@ def get_zlib_library(self, cmake):
20602060
# it this way then allows the page to close() itself when done.
20612061
def harness_server_func(in_queue, out_queue, port):
20622062
class TestServerHandler(SimpleHTTPRequestHandler):
2063-
# Request header handler for default do_GET() path in
2064-
# SimpleHTTPRequestHandler.do_GET(self) below.
2065-
def send_head(self):
2066-
if self.path.endswith('.js'):
2067-
path = self.translate_path(self.path)
2068-
try:
2069-
f = open(path, 'rb')
2070-
except IOError:
2071-
self.send_error(404, "File not found: " + path)
2072-
return None
2073-
self.send_response(200)
2074-
self.send_header('Content-type', 'application/javascript')
2075-
self.send_header('Connection', 'close')
2076-
self.end_headers()
2077-
return f
2078-
else:
2079-
return SimpleHTTPRequestHandler.send_head(self)
2080-
20812063
# Add COOP, COEP, CORP, and no-caching headers
20822064
def end_headers(self):
20832065
self.send_header('Access-Control-Allow-Origin', '*')

0 commit comments

Comments
 (0)