← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/bug-751982 into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/bug-751982 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #751982 in Launchpad itself: "ForbiddenAttribute: ('publishTraverse', <canonical.launchpad.webapp.publisher.RedirectionView object at INSTANCE-ID>)"
  https://bugs.launchpad.net/launchpad/+bug/751982

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bug-751982/+merge/59162

RedirectionView gets upset if there are unprocessed path segments, which can hit FileNavigationMixin like OOPS-1918D1292. This branch fixes traverse_files to 404 if there are further path segments.
-- 
https://code.launchpad.net/~wgrant/launchpad/bug-751982/+merge/59162
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bug-751982 into lp:launchpad.
=== modified file 'lib/canonical/launchpad/browser/librarian.py'
--- lib/canonical/launchpad/browser/librarian.py	2011-03-28 05:45:16 +0000
+++ lib/canonical/launchpad/browser/librarian.py	2011-04-27 04:28:26 +0000
@@ -101,6 +101,10 @@
         if library_file.deleted:
             raise DeletedProxiedLibraryFileAlias(filename, self.context)
 
+        # There can be no further path segments.
+        if len(self.request.stepstogo) > 0:
+            return None
+
         return RedirectionView(
             library_file.getURL(include_token=True),
             self.request)

=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-files.txt'
--- lib/lp/soyuz/stories/ppa/xx-ppa-files.txt	2011-03-28 05:15:44 +0000
+++ lib/lp/soyuz/stories/ppa/xx-ppa-files.txt	2011-04-27 04:28:26 +0000
@@ -291,6 +291,13 @@
     Location: http://.../test-pkg_1.0.dsc
     ...
 
+The filename must be at the end of the URL. No further segments are permitted.
+
+    >>> browser.open(file_lp_url + '/foo')
+    Traceback (most recent call last):
+    ...
+    NotFound: ...
+
 
 == Compatibility URL Redirection ==