Skip to content

Commit d8b61f0

Browse files
committed
Use Werkzeug Headers to store headers
This allows case-insensitive matching of header names.
1 parent 5502c40 commit d8b61f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pytest_localserver/http.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import sys
88
import threading
99

10+
from werkzeug.datastructures import Headers
1011
from werkzeug.serving import make_server
1112
from werkzeug.wrappers import Response, Request
1213

@@ -111,9 +112,10 @@ def serve_content(self, content, code=200, headers=None):
111112
# this probably means that content is not iterable, so just go
112113
# ahead in case it's some type that Response knows how to handle
113114
pass
114-
self.content, self.code = (content, code)
115+
self.content = content
116+
self.code = code
115117
if headers:
116-
self.headers = headers
118+
self.headers = Headers(headers)
117119

118120

119121
if __name__ == '__main__': # pragma: no cover

0 commit comments

Comments
 (0)