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

Custom value for Upgrade header is removed #1587

Closed
postlund opened this issue Feb 5, 2017 · 4 comments
Closed

Custom value for Upgrade header is removed #1587

postlund opened this issue Feb 5, 2017 · 4 comments
Labels

Comments

@postlund
Copy link

postlund commented Feb 5, 2017

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:https://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

@fafhrd91
Copy link
Member

fafhrd91 commented Feb 6, 2017

should be fixed in master

@fafhrd91 fafhrd91 closed this as completed Feb 6, 2017
@fafhrd91
Copy link
Member

fafhrd91 commented Feb 6, 2017

please open another ticket if you'll have other problems

fafhrd91 pushed a commit that referenced this issue Feb 6, 2017
@postlund
Copy link
Author

postlund commented Feb 6, 2017

Great, thank you very much!

@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

No branches or pull requests

2 participants