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

Websocket connection header is case-insensitive #11267

Merged
merged 1 commit into from
Jan 12, 2017

Conversation

emlove
Copy link
Contributor

@emlove emlove commented Dec 24, 2016

Description

This change makes the websocket connection header check case insensitive. Per RFC 6455, 4.2.1.4, this check should be case insensitive.

Motivation and Context

Not all websocket clients will send the connection header using the same case that Kodi is expecting. See aio-libs/aiohttp#1495.

How Has This Been Tested?

This has been tested by connecting to Kodi using Python's aiohttp v1.2.0, using the following test script:

import aiohttp
import asyncio

@asyncio.coroutine
def main(loop):
    client = aiohttp.ClientSession(loop=loop)
    ws = yield from client.ws_connect('ws://192.168.1.193:9090/jsonrpc')
    while True:
        msg = yield from ws.receive()
        if msg.type == aiohttp.WSMsgType.TEXT:
            print(msg)
        elif msg.type == aiohttp.WSMsgType.CLOSED:
            break
        elif msg.type == aiohttp.WSMsgType.ERROR:
            break

loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the Code guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have added tests to cover my change
  • All new and existing tests passed

@Montellese Montellese added the Type: Fix non-breaking change which fixes an issue label Dec 25, 2016
@Montellese Montellese added this to the L 18.0-alpha1 milestone Dec 25, 2016
@Montellese
Copy link
Member

jenkins build and merge

@MartijnKaijser
Copy link
Member

jenkins build this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport: Done Type: Fix non-breaking change which fixes an issue v18 Leia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants