File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ the ``Host`` header to figure out the subdomain one simply looks at the
146146request path up to the first slash::
147147
148148 from threading import Lock
149- from werkzeug.wsgi import pop_path_info, peek_path_info
149+ from wsgiref.util import shift_path_info
150150
151151 class PathDispatcher:
152152
@@ -166,13 +166,20 @@ request path up to the first slash::
166166 return app
167167
168168 def __call__(self, environ, start_response):
169- app = self.get_application(peek_path_info (environ))
169+ app = self.get_application(self._peek_path_info (environ))
170170 if app is not None:
171- pop_path_info (environ)
171+ shift_path_info (environ)
172172 else:
173173 app = self.default_app
174174 return app(environ, start_response)
175175
176+ def _peek_path_info(environ):
177+ segments = environ.get("PATH_INFO", "").lstrip("/").split("/", 1)
178+ if segments:
179+ return segments[0]
180+
181+ return None
182+
176183The big difference between this and the subdomain one is that this one
177184falls back to another application if the creator function returns ``None ``::
178185
You can’t perform that action at this time.
0 commit comments