Permalink
Browse files

explicitly cast location headers to string for supporting mod_wsgi

  • Loading branch information...
1 parent ab12cb4 commit f555f0cf15b3ae8fae62ac9d4d902e2285887fd3 richard-jones committed May 1, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 sss/pylons_sword_controller.py
@@ -610,7 +610,7 @@ def _POST_collection(self, path=None):
# created
ssslog.info("Item created")
response.content_type = "application/atom+xml;type=entry"
- response.headers["Location"] = result.location
+ response.headers["Location"] = str(result.location) # explicit cast to string
response.status_int = 201
response.status = "201 Created"
if config.return_deposit_receipt:
@@ -744,7 +744,7 @@ def _POST_media_resource(self, path=None):
result = ss.add_content(path, deposit)
response.content_type = "application/atom+xml;type=entry"
- response.headers["Location"] = result.location
+ response.headers["Location"] = str(result.location) # explict cast to str
response.status_int = 201
response.status = "201 Created"
if config.return_deposit_receipt:
@@ -869,7 +869,7 @@ def _PUT_container(self, path=None):
ss = SwordServer(config, auth)
result = ss.replace(path, deposit)
- response.headers["Location"] = result.location
+ response.headers["Location"] = str(result.location) # explicit cast to str
if config.return_deposit_receipt:
response.content_type = "application/atom+xml;type=entry"
response.status_int = 200
@@ -919,7 +919,7 @@ def _POST_container(self, path=None):
# in this case the spec is incorrect (correction need to be implemented
# asap)
- response.headers["Location"] = result.location
+ response.headers["Location"] = str(result.location) # explict cast to str
response.status_int = 200
response.status = "200 OK"
if config.return_deposit_receipt:

0 comments on commit f555f0c

Please sign in to comment.