Mageia Bugzilla – Attachment 12526 Details for
Bug 28490
python-aiohttp new security issue CVE-2021-21330
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Simple client script
aio_http_client.py (text/plain), 434 bytes, created by
Len Lawrence
on 2021-03-26 17:05:10 CET
(
hide
)
Description:
Simple client script
Filename:
MIME Type:
Creator:
Len Lawrence
Created:
2021-03-26 17:05:10 CET
Size:
434 bytes
patch
obsolete
>import aiohttp >import asyncio > >async def main(): > > async with aiohttp.ClientSession() as session: > async with session.get('http://python.org') as response: > > print("Status:", response.status) > print("Content-type:", response.headers['content-type']) > > html = await response.text() > print("Body:", html[:15], "...") > >loop = asyncio.get_event_loop() >loop.run_until_complete(main())
import aiohttp import asyncio async def main(): async with aiohttp.ClientSession() as session: async with session.get('http://python.org') as response: print("Status:", response.status) print("Content-type:", response.headers['content-type']) html = await response.text() print("Body:", html[:15], "...") loop = asyncio.get_event_loop() loop.run_until_complete(main())
View Attachment As Raw
Actions:
View
Attachments on
bug 28490
:
12524
|
12525
| 12526