Mercurial > piecrust2
comparison piecrust/serving.py @ 330:de4903457bed
serve: Fix crash on URI parsing.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 01 Apr 2015 00:26:54 -0700 |
parents | 65e6d72f3877 |
children | b034f6f15e22 |
comparison
equal
deleted
inserted
replaced
329:422052d2e978 | 330:de4903457bed |
---|---|
413 'rss': 'application/rss+xml', # or 'text/xml'? | 413 'rss': 'application/rss+xml', # or 'text/xml'? |
414 'json': 'application/json'} | 414 'json': 'application/json'} |
415 | 415 |
416 | 416 |
417 def find_routes(routes, uri): | 417 def find_routes(routes, uri): |
418 uri = uri.lstrip('/') | |
419 res = [] | 418 res = [] |
420 for route in routes: | 419 for route in routes: |
421 metadata = route.matchUri(uri) | 420 metadata = route.matchUri(uri) |
422 if metadata is not None: | 421 if metadata is not None: |
423 res.append((route, metadata)) | 422 res.append((route, metadata)) |