Make header parsing case insensitive.

This makes darkhttpd more useful behind an HTTP2 reverse proxy,
because the HTTP2 headers are all lowercase.

Suggested by: @Hill-98

Fixes #15
This commit is contained in:
Emil Mikulic
2022-01-19 20:01:32 +11:00
parent 1759a7a7d9
commit f0ca481fd1
2 changed files with 7 additions and 2 deletions

View File

@@ -385,6 +385,11 @@ class TestFileGet(TestHelper):
status, hdrs, body = parse(resp)
self.assertContains(status, "416 Requested Range Not Satisfiable")
def test_lowercase_header(self):
resp = self.get(self.url, req_hdrs = {"range": "bytes=20-10"})
status, hdrs, body = parse(resp)
self.assertContains(status, "416 Requested Range Not Satisfiable")
class TestKeepAlive(TestFileGet):
"""
Run all of TestFileGet but with a single long-lived connection.