Skip to content

Commit c7a43f8

Browse files
committed
Properly unescape URLs for the dev server; resolves #68
1 parent 127a1cc commit c7a43f8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Bug fixes
66

77
- Fix support for Unicode in redirection templates
8+
- Properly decode paths in the development server
89

910
---
1011

Diff for: mike/server.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from .app_version import version
99

1010

11-
def _to_git_path(path):
12-
path = posixpath.normpath(urlparse.urlsplit(path).path)
11+
def _to_git_path(url):
12+
path = posixpath.normpath(urlparse.unquote(url.path))
1313
return path[1:]
1414

1515

@@ -29,10 +29,10 @@ def do_GET(self):
2929
self.wfile.write(body)
3030

3131
def send_headers(self):
32-
path = _to_git_path(self.path)
32+
url = urlparse.urlsplit(self.path)
33+
path = _to_git_path(url)
3334
try:
3435
if stat.S_ISDIR(git_utils.file_mode(self.branch, path)):
35-
url = urlparse.urlsplit(self.path)
3636
if not url.path.endswith('/'):
3737
# Redirect the browser to a URL with a slash at the end,
3838
# like Apache.

0 commit comments

Comments
 (0)