Allow publisher_signature to have embedded path components (a prefix) #60
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
/myapp
if needed.If the prefix is enabled, I'm setting the publisher signature to something like:
myapp/bowerstatic
If 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 returnsmyapp
when my prefix is enabled. This fails to match the publisher signature ofmyapp/bowerstatic
so 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.