Skip to content

Custom value for Upgrade header is removed #1587

Closed
@postlund

Description

Long story short

I'm writing a client library for the Apple TV and want to add support for playing media based on an URL via AirPlay. To receive events (so that I know when it's done playing), I need a reverse HTTP connection. This requires me to "upgrade" the connection to PTTH/1.0 but aiohttp does not allow me to set this header.

Expected behaviour

Header should be included like any other header.

Actual behaviour

It is ignored which makes the Apple TV respond with a 412. Only "websocket" works.

Steps to reproduce

Concept of what I'm trying to do:

headers = {
    'Upgrade': 'PTTH/1.0',
    'Connection': 'Upgrade',
    'X-Apple-Purpose': 'event',
    'User-Agent': 'MediaControl/1.0',
    'X-Apple-Session-ID': '1bd6ceeb-fffd-456c-a09c-996053a7a08c'
}
skip = ['Content-Type', 'Accept-Encoding', 'Accept', 'Host']
tmp = yield from session.post('http://10.0.10.22:7000/reverse',
    headers=headers, skip_auto_headers=skip)

All other headers are included, but "Upgrade" is left out. I'm quite stuck here unless there's some other solution I can use? Or can this behavior be supported?

Your environment

Local network, python 3.5.1 on macOS 10.12.3, aiohttp 1.2.0

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions