aio-libs / aio-libs/aiohttp

ClientSession cookies does not work with IP

オープン
#1,183 コメント 16 件 リアクション 4 件 担当者 0 名 GitHub で見る
enhancement need pull request
主要言語
Python
スター
16.5k
フォーク
2.4k
平均マージ
17時間 22分
マージ済み PR(30日)
212

説明

## Long story short

I use `127.0.0.1` instead of `localhost` for development and wasted few hours before understand why my tests breaks :)

```
import asyncio
import aiohttp

async def main():
urls = [
'http://httpbin.org/cookies/set?test=ok',
'http://54.175.219.8/cookies/set?test=ok',
]
for url in urls:
with aiohttp.ClientSession() as s:
async with s.get(url) as r:
print(await r.json())
print(list(s.cookie_jar))

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```
## Actual behaviour

```
{'cookies': {'test': 'ok'}}
[]
{'cookies': {}}
[]
```
## Your environment

Last stable release of aiohttp, linux

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。