Opened 12 years ago

Closed 2 years ago

#1920 defect closed invalid (invalid) RedirectResponse takes a full href, not a uri

Reported by: karpet Owned by:
Priority: normal Milestone:
Component: web2 Keywords:
Cc: Jean-Paul Calderone Branch:


--- (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 (4)

comment:1 Changed 11 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 11 years ago by Jean-Paul Calderone

Cc: Jean-Paul Calderone 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 7 years ago by <automation>

Owner: jknight deleted

comment:4 Changed 2 years ago by hawkowl

Resolution: invalid
Status: newclosed

web2 does not exist anymore, so, batch-closing these as invalid.

Note: See TracTickets for help on using tickets.