Skip to content

Commit

Permalink
Allow the publisher_signature to have embedded path components. E.g. …
Browse files Browse the repository at this point in the history
…a prefix like /myapp/bowerstatic.
  • Loading branch information
Preston-Landers authored and Preston Landers committed Dec 17, 2015
1 parent df07f7b commit 5c37298
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 5c37298

Please sign in to comment.