Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not filter cookies if unsafe flag provided #1005

Merged
merged 2 commits into from
Jul 26, 2016
Merged

Conversation

bmwant
Copy link
Member

@bmwant bmwant commented Jul 26, 2016

What do these changes do?

For the testing purposes or when user is aware about what he is doing it's handy to be able provide unsafe cookie jar (so cookies will be preserved even for domain specified as IP address, e.g. 127.0.0.1)

Are there changes in behavior for the user?

cookie_jar = aiohttp.CookieJar(loop=loop, unsafe=True)
with aiohttp.ClientSession(loop=loop, cookie_jar=cookie_jar) as session:
    resp = await session.get('http://127.0.0.1/')
    print(resp.cookies)
    await resp.release()

Now cookies right in place

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

@coveralls
Copy link

coveralls commented Jul 26, 2016

Coverage Status

Coverage remained the same at 97.971% when pulling fd22462 on kpidata:master into 32c0f1d on KeepSafe:master.

@asvetlov
Copy link
Member

Shame on me, I've missed the second IP address check.

@asvetlov asvetlov merged commit 7dad207 into aio-libs:master Jul 26, 2016
@asvetlov
Copy link
Member

Will be fixed in aiohttp 0.22.3

asvetlov pushed a commit that referenced this pull request Jul 26, 2016
* Add test for unsafe cookies jar

* Remove code duplication and make base class for testing CookieJar
@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants