Skip to content

Commit 786aaad

Browse files
Allow the publisher_signature to have embedded path components. E.g. a prefix like /myapp/bowerstatic.
1 parent e696aa7 commit 786aaad

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bowerstatic/publisher.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ def __init__(self, bower, handler):
1919

2020
def __call__(self, request):
2121
# first segment should be publisher signature
22-
publisher_signature = request.path_info_peek()
22+
publisher_signature = request.path_info[1:][:len(self.bower.publisher_signature)]
2323
# pass through to underlying WSGI app
2424
if publisher_signature != self.bower.publisher_signature:
2525
return self.handler(request)
26-
request.path_info_pop()
26+
# pop off the entire publisher signature
27+
for ignored_signature_part in self.bower.publisher_signature.split("/"):
28+
request.path_info_pop()
2729
# next segment is BowerComponents name
2830
bower_components_name = request.path_info_pop()
2931
if bower_components_name is None:

0 commit comments

Comments
 (0)