1.1 --- a/WebStack/Resources/ResourceMap.py Thu Aug 25 13:44:38 2005 +0000
1.2 +++ b/WebStack/Resources/ResourceMap.py Thu Aug 25 16:35:23 2005 +0000
1.3 @@ -150,7 +150,7 @@
1.4 trans.set_response_code(404)
1.5 trans.set_content_type(WebStack.Generic.ContentType("text/plain"))
1.6 out = trans.get_response_stream()
1.7 - out.write("Resource '%s' not found." % trans.get_path_info())
1.8 + out.write("Resource '%s' not found." % trans.get_path_info(self.urlencoding))
1.9
1.10 def send_redirect(self, trans):
1.11
1.12 @@ -159,12 +159,13 @@
1.13 end of the request path.
1.14 """
1.15
1.16 + path_without_query = trans.get_path_without_query(self.urlencoding)
1.17 query_string = trans.get_query_string()
1.18 if query_string:
1.19 query_string = "?" + query_string
1.20
1.21 trans.set_response_code(302)
1.22 - trans.set_header_value("Location", trans.get_path_without_query() + "/" + query_string)
1.23 + trans.set_header_value("Location", trans.encode_path(path_without_query, self.urlencoding) + "/" + query_string)
1.24 raise WebStack.Generic.EndOfResponse
1.25
1.26 # vim: tabstop=4 expandtab shiftwidth=4
2.1 --- a/examples/Common/Calendar/__init__.py Thu Aug 25 13:44:38 2005 +0000
2.2 +++ b/examples/Common/Calendar/__init__.py Thu Aug 25 16:35:23 2005 +0000
2.3 @@ -85,7 +85,7 @@
2.4 <D:status>HTTP/1.1 200 OK</D:status>
2.5 </D:propstat>
2.6 </D:response>
2.7 -""" % (trans.get_path_without_query(), time_now, trans.get_path_without_query()))
2.8 +""" % (trans.get_path_without_query(self.urlencoding), time_now, trans.get_path_without_query(self.urlencoding)))
2.9
2.10 for filename in os.listdir(self.resource_dir):
2.11 pathname = os.path.join(self.resource_dir, filename)
2.12 @@ -105,7 +105,7 @@
2.13 <D:status>HTTP/1.1 200 OK</D:status>
2.14 </D:propstat>
2.15 </D:response>
2.16 -""" % (trans.get_path_without_query(), filename, created, filename, "text/calendar", size))
2.17 +""" % (trans.get_path_without_query(self.urlencoding), filename, created, filename, "text/calendar", size))
2.18
2.19 out.write("""
2.20 </D:multistatus>
3.1 --- a/examples/Common/Cookies/__init__.py Thu Aug 25 13:44:38 2005 +0000
3.2 +++ b/examples/Common/Cookies/__init__.py Thu Aug 25 16:35:23 2005 +0000
3.3 @@ -9,13 +9,15 @@
3.4
3.5 "A resource adding and removing cookies."
3.6
3.7 + urlencoding = "utf-8"
3.8 +
3.9 def respond(self, trans):
3.10 trans.set_content_type(WebStack.Generic.ContentType("text/html"))
3.11
3.12 # Get the fields and choose an action.
3.13
3.14 fields_from_path = trans.get_fields_from_path()
3.15 - path = trans.get_path_without_query()
3.16 + path = trans.get_path_without_query(self.urlencoding)
3.17
3.18 # If the "set method" form was used, set the new method.
3.19