| 9 | from StringIO import StringIO |
| 10 | |
| 11 | class StripPathMiddleware(object): |
| 12 | def __init__(self, app): |
| 13 | self.app = app |
| 14 | |
| 15 | def __call__(self, e, h): |
| 16 | e['PATH_INFO'] = e['PATH_INFO'].rstrip('/') |
| 17 | return self.app(e, h) |
| 18 | |
| 19 | |
| 20 | class PrefixMiddleware(object): |