Merge pull request #475 from andrew-d/master
addslash / removeslash modification
This commit is contained in:
commit
cdaa99afbe
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue