Opened 9 years ago

Last modified 9 years ago

#1920 defect new RedirectResponse takes a full href, not a uri

Reported by: karpet Owned by:
Priority: normal Milestone:
Component: web2 Keywords:
Cc: exarkun Branch:
Author: Launchpad Bug:


--- (revision 17515)
+++ (working copy)
@@ -469,7 +469,7 @@
         # If this is a collection and the URI doesn't end in "/", redirect.
         if self.isCollection() and request.uri[-1:] != "/":
-            return RedirectResponse(request.uri + "/")
+            return RedirectResponse(request.unparseURL(path=request.uri + "/"))

         def setHeaders(response):
             response = IResponse(response)

Change History (3)

comment:1 Changed 9 years ago by rfmohr@…

Is there any chance that this fix will be merged in soon? The current implementation violates the spec, and the patch above easily fixes the problem.

(I just spent a couple of hours tracking down some weird behavior, and I finally isolated it to this problem. The behavior is only triggered in certain fringe cases, but fixing this bug might save others some time in the future.)

comment:2 Changed 9 years ago by exarkun

  • Cc exarkun added

Supplying a unit test which fails without this fix will speed up its acceptance.

Otherwise, this'll get applied when someone else finds the time to figure out how to trigger the bad behavior and then writes a unit test for it and verifies this patch fixes the problem.

comment:3 Changed 5 years ago by <automation>

  • Owner jknight deleted
Note: See TracTickets for help on using tickets.