Skip to content

Commit 8ca24a4

Browse files
committed
Merge branch '0.21'
2 parents 024f6e1 + 87a2c32 commit 8ca24a4

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

CHANGES.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ CHANGES
2626

2727
- Allow to pass None as a timeout value to disable timeout logic #834
2828

29-
0.21.5 (04-22-2016)
29+
0.21.6 (05-05-2016)
30+
-------------------
31+
32+
- Drop initial query parameters on redirects #853
33+
34+
0.21.5 (03-22-2016)
3035
-------------------
3136

3237
- Fix command line arg parsing #797

aiohttp/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def _request(self, method, url, *,
235235
r_url = urllib.parse.urljoin(url, r_url)
236236

237237
url = r_url
238+
params = None
238239
yield from resp.release()
239240
continue
240241

docs/client_reference.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ The client session supports the context manager protocol for self closing.
138138

139139
:param params: Mapping, iterable of tuple of *key*/*value* pairs or
140140
string to be sent as parameters in the query
141-
string of the new request (optional)
141+
string of the new request. Ignored for subsequent
142+
redirected requests (optional)
142143

143144
Allowed values are:
144145

requirements-ci.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pip
22
flake8
3-
pyflakes>=1.0.0
3+
pyflakes==1.1.0
44
coverage
55
sphinx
66
alabaster>=0.6.2

tests/test_client_functional.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,28 @@ def handler(request):
338338
yield from resp.release()
339339

340340

341+
@pytest.mark.run_loop
342+
def test_drop_params_on_redirect(create_app_and_client):
343+
@asyncio.coroutine
344+
def handler_redirect(request):
345+
return web.Response(status=301, headers={'Location': '/ok?a=redirect'})
346+
347+
@asyncio.coroutine
348+
def handler_ok(request):
349+
assert request.query_string == 'a=redirect'
350+
return web.Response(status=200)
351+
352+
app, client = yield from create_app_and_client()
353+
app.router.add_route('GET', '/ok', handler_ok)
354+
app.router.add_route('GET', '/redirect', handler_redirect)
355+
356+
resp = yield from client.get('/redirect', params={'a': 'initial'})
357+
try:
358+
assert resp.status == 200
359+
finally:
360+
yield from resp.release()
361+
362+
341363
@pytest.mark.run_loop
342364
def test_history(create_app_and_client):
343365
@asyncio.coroutine

0 commit comments

Comments
 (0)