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
=== modified file 'license_protected_downloads/views.py'
--- license_protected_downloads/views.py 2013-04-02 09:58:42 +0000
+++ license_protected_downloads/views.py 2013-04-05 09:49:30 +0000
@@ -17,7 +17,7 @@
17)17)
18from django.shortcuts import render_to_response, redirect18from django.shortcuts import render_to_response, redirect
19from django.template import RequestContext19from django.template import RequestContext
20from django.utils.encoding import smart_str20from django.utils.encoding import smart_str, iri_to_uri
2121
22import bzr_version22import bzr_version
23from buildinfo import BuildInfo, IncorrectDataFormatException23from buildinfo import BuildInfo, IncorrectDataFormatException
@@ -394,6 +394,7 @@
394394
395def file_server(request, path):395def file_server(request, path):
396 """Serve up a file / directory listing or license page as required"""396 """Serve up a file / directory listing or license page as required"""
397 path = iri_to_uri(path)
397 url = path398 url = path
398 result = test_path(path)399 result = test_path(path)
399 if not result:400 if not result:
@@ -511,6 +512,7 @@
511512
512513
513def list_files_api(request, path):514def list_files_api(request, path):
515 path = iri_to_uri(path)
514 url = path516 url = path
515 result = test_path(path)517 result = test_path(path)
516 if not result:518 if not result:
@@ -554,6 +556,7 @@
554556
555557
556def get_license_api(request, path):558def get_license_api(request, path):
559 path = iri_to_uri(path)
557 result = test_path(path)560 result = test_path(path)
558 if not result:561 if not result:
559 raise Http404562 raise Http404

Subscribers

People subscribed via source and target branches