Skip to content

Commit

Permalink
Merge branch '0.21'
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed May 5, 2016
2 parents 024f6e1 + 87a2c32 commit 8ca24a4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ CHANGES

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

0.21.5 (04-22-2016)
0.21.6 (05-05-2016)
-------------------

- Drop initial query parameters on redirects #853

0.21.5 (03-22-2016)
-------------------

- Fix command line arg parsing #797
Expand Down
1 change: 1 addition & 0 deletions aiohttp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def _request(self, method, url, *,
r_url = urllib.parse.urljoin(url, r_url)

url = r_url
params = None
yield from resp.release()
continue

Expand Down
3 changes: 2 additions & 1 deletion docs/client_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ The client session supports the context manager protocol for self closing.

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

Allowed values are:

Expand Down
2 changes: 1 addition & 1 deletion requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pip
flake8
pyflakes>=1.0.0
pyflakes==1.1.0
coverage
sphinx
alabaster>=0.6.2
Expand Down
22 changes: 22 additions & 0 deletions tests/test_client_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,28 @@ def handler(request):
yield from resp.release()


@pytest.mark.run_loop
def test_drop_params_on_redirect(create_app_and_client):
@asyncio.coroutine
def handler_redirect(request):
return web.Response(status=301, headers={'Location': '/ok?a=redirect'})

@asyncio.coroutine
def handler_ok(request):
assert request.query_string == 'a=redirect'
return web.Response(status=200)

app, client = yield from create_app_and_client()
app.router.add_route('GET', '/ok', handler_ok)
app.router.add_route('GET', '/redirect', handler_redirect)

resp = yield from client.get('/redirect', params={'a': 'initial'})
try:
assert resp.status == 200
finally:
yield from resp.release()


@pytest.mark.run_loop
def test_history(create_app_and_client):
@asyncio.coroutine
Expand Down

0 comments on commit 8ca24a4

Please sign in to comment.