Merge lp:~dooferlad/linaro-license-protection/unicode-fix into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by James Tunnicliffe
Status: Merged
Approved by: Stevan Radaković
Approved revision: 180
Merged at revision: 181
Proposed branch: lp:~dooferlad/linaro-license-protection/unicode-fix
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 36 lines (+4/-1)
1 file modified
license_protected_downloads/views.py (+4/-1)
To merge this branch: bzr merge lp:~dooferlad/linaro-license-protection/unicode-fix
Reviewer Review Type Date Requested Status
Stevan Radaković Approve
Review via email: mp+157311@code.launchpad.net

Description of the change

Convert possibly unicode containing IRIs into URIs before handling them.

To post a comment you must log in.
Revision history for this message
Stevan Radaković (stevanr) wrote :

Looks good.
Approve +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'license_protected_downloads/views.py'
2--- license_protected_downloads/views.py 2013-04-02 09:58:42 +0000
3+++ license_protected_downloads/views.py 2013-04-05 09:49:30 +0000
4@@ -17,7 +17,7 @@
5 )
6 from django.shortcuts import render_to_response, redirect
7 from django.template import RequestContext
8-from django.utils.encoding import smart_str
9+from django.utils.encoding import smart_str, iri_to_uri
10
11 import bzr_version
12 from buildinfo import BuildInfo, IncorrectDataFormatException
13@@ -394,6 +394,7 @@
14
15 def file_server(request, path):
16 """Serve up a file / directory listing or license page as required"""
17+ path = iri_to_uri(path)
18 url = path
19 result = test_path(path)
20 if not result:
21@@ -511,6 +512,7 @@
22
23
24 def list_files_api(request, path):
25+ path = iri_to_uri(path)
26 url = path
27 result = test_path(path)
28 if not result:
29@@ -554,6 +556,7 @@
30
31
32 def get_license_api(request, path):
33+ path = iri_to_uri(path)
34 result = test_path(path)
35 if not result:
36 raise Http404

Subscribers

People subscribed via source and target branches