Skip to content

Bracket IPv6 addresses in the HOST header #3304

Closed
@pollydrag

Description

Long story short

ClientSession does not bracket the IPv6 addresses in the HOST header.

Expected behaviour

GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Host: [::1]:99
User-Agent: Python/3.6 aiohttp/3.5.0a0

Actual behaviour

GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Host: ::1:99
User-Agent: Python/3.6 aiohttp/3.5.0a0

Steps to reproduce

async with aiohttp.ClientSession() as client:
    await client.get('http://[::1]:99')      

Your environment

  1. aiohttp 3.5.0a0
  2. python 3.6
  3. ubuntu 16.04
  4. aiohttp client

Metadata

Assignees

No one assigned

    Labels

    HacktoberfestWe think it's good for https://hacktoberfest.digitalocean.com/buggood first issueGood for newcomersoutdated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions