From 5c37298471db4c164665cb46f279fb55243ab86e Mon Sep 17 00:00:00 2001 From: Preston Landers Date: Sun, 19 Jul 2015 16:01:40 -0500 Subject: [PATCH] Allow the publisher_signature to have embedded path components. E.g. a prefix like /myapp/bowerstatic. --- bowerstatic/publisher.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bowerstatic/publisher.py b/bowerstatic/publisher.py index b780971..465665e 100644 --- a/bowerstatic/publisher.py +++ b/bowerstatic/publisher.py @@ -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: