Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow publisher_signature to have embedded path components (a prefix) #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bowerstatic/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ def __init__(self, bower, handler):

def __call__(self, request):
# first segment should be publisher signature
publisher_signature = request.path_info_peek()
publisher_signature = request.path_info[1:][:len(self.bower.publisher_signature)]
# pass through to underlying WSGI app
if publisher_signature != self.bower.publisher_signature:
return self.handler(request)
request.path_info_pop()
# pop off the entire publisher signature
for ignored_signature_part in self.bower.publisher_signature.split("/"):
request.path_info_pop()
# next segment is BowerComponents name
bower_components_name = request.path_info_pop()
if bower_components_name is None:
Expand Down