Merge ~pappacena/turnip:py3-http-detect-git-request into turnip:master

Proposed by Thiago F. Pappacena
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: 25b8919309143560f8b50a8569bef18388c0cc40
Merged at revision: 5ca736e7bc89fff3e684de6995567614e0cfbfc1
Proposed branch: ~pappacena/turnip:py3-http-detect-git-request
Merge into: turnip:master
Diff against target: 28 lines (+3/-3)
2 files modified
turnip/pack/http.py (+2/-2)
turnip/pack/tests/test_functional.py (+1/-1)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+394364@code.launchpad.net

Commit message

Detecting git HTTP requests - py3 compatibility

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/turnip/pack/http.py b/turnip/pack/http.py
2index a441ddc..582c39c 100644
3--- a/turnip/pack/http.py
4+++ b/turnip/pack/http.py
5@@ -762,8 +762,8 @@ class SmartHTTPFrontendResource(resource.Resource):
6 @staticmethod
7 def _isGitRequest(request):
8 if request.path.endswith(b'/info/refs'):
9- service = request.args.get('service', [])
10- if service and service[0].startswith('git-'):
11+ service = request.args.get(b'service', [])
12+ if service and service[0].startswith(b'git-'):
13 return True
14 content_type = request.getHeader(b'Content-Type')
15 if content_type is None:
16diff --git a/turnip/pack/tests/test_functional.py b/turnip/pack/tests/test_functional.py
17index c044968..eb52f62 100644
18--- a/turnip/pack/tests/test_functional.py
19+++ b/turnip/pack/tests/test_functional.py
20@@ -805,7 +805,7 @@ class TestSmartHTTPFrontendFunctional(FrontendFunctionalTestMixin, TestCase):
21 b'HEAD', b'http://localhost:%d/' % self.port)
22 self.assertEqual(302, response.code)
23 self.assertEqual(
24- [version_info['revision_id']],
25+ [six.ensure_binary(version_info['revision_id'])],
26 response.headers.getRawHeaders(b'X-Turnip-Revision'))
27
28 def make_set_symbolic_ref_request(self, line):

Subscribers

People subscribed via source and target branches