Merge pull request #475 from andrew-d/master

addslash / removeslash modification
This commit is contained in:
bdarnell 2012-03-24 13:06:50 -07:00
commit cdaa99afbe
1 changed files with 2 additions and 2 deletions

View File

@ -1100,7 +1100,7 @@ def removeslash(method):
if uri: # don't try to redirect '/' to '' if uri: # don't try to redirect '/' to ''
if self.request.query: if self.request.query:
uri += "?" + self.request.query uri += "?" + self.request.query
self.redirect(uri) self.redirect(uri, permanent = True)
return return
else: else:
raise HTTPError(404) raise HTTPError(404)
@ -1122,7 +1122,7 @@ def addslash(method):
uri = self.request.path + "/" uri = self.request.path + "/"
if self.request.query: if self.request.query:
uri += "?" + self.request.query uri += "?" + self.request.query
self.redirect(uri) self.redirect(uri, permanent = True)
return return
raise HTTPError(404) raise HTTPError(404)
return method(self, *args, **kwargs) return method(self, *args, **kwargs)