Allow publisher_signature to have embedded path components (a prefix)#60
Open
Preston-Landers wants to merge 1 commit intofaassen:masterfrom
Open
Allow publisher_signature to have embedded path components (a prefix)#60Preston-Landers wants to merge 1 commit intofaassen:masterfrom
Preston-Landers wants to merge 1 commit intofaassen:masterfrom
Conversation
Owner
|
I'm happy to accept this pull request but it needs some tests. I'm especially curious about the |
Author
|
Yes, it was getting rid of the initial slash. I'm pretty sure there will always be a slash there but I can verify that or add some conditional logic. |
…a prefix like /myapp/bowerstatic.
786aaad to
5c37298
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello, I'm trying to support a global URL prefix for my app, so that all URLs have a prefix like
/myappif needed.If the prefix is enabled, I'm setting the publisher signature to something like:
myapp/bowerstaticIf there is no prefix enabled the signature is just
bowerstatic.So when I do this, my URLs to bower resources are getting generated correctly, but the publisher tween fails to recognize and serve them. The problem appears to be that in publisher.py at line 22 it calls
request.path_info_peek. This only returns the first component of the URL, so it only returnsmyappwhen my prefix is enabled. This fails to match the publisher signature ofmyapp/bowerstaticso it fails to serve the file.It would be nice if it could recognize a multi-part signature is in use and match the whole thing. This PR allows the publisher signature to have embedded slashes (path components).
My app is a mixture of Pyramid and a custom/legacy framework, but in theory that shouldn't matter here.