Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
Respect multiple headers with the same name in .headers files. (#95)
Browse files Browse the repository at this point in the history
* Respect multiple headers with the same name in .headers files.

Fixes #90.
  • Loading branch information
Ms2ger authored and jgraham committed Aug 25, 2016
1 parent fcfb8cc commit f58dace
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/functional/docroot/with_headers.txt.sub.headers
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Custom-Header: PASS
Another-Header: {{$id:uuid()}}
Same-Value-Header: {{$id}}
Double-Header: PA
Double-Header: SS
1 change: 1 addition & 0 deletions tests/functional/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def test_headers(self):
# This will fail if it isn't a valid uuid
uuid.UUID(resp.info()["Another-Header"])
self.assertEqual(resp.info()["Same-Value-Header"], resp.info()["Another-Header"])
self.assertEqual(resp.info()["Double-Header"], "PA, SS")


def test_range(self):
Expand Down
2 changes: 1 addition & 1 deletion wptserve/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def items(self):

def update(self, items_iter):
for name, value in items_iter:
self.set(name, value)
self.append(name, value)

def __repr__(self):
return repr(self.data)
Expand Down

0 comments on commit f58dace

Please sign in to comment.