stephen/httplike — pull request #8 by stephank (2014-11-11 19:19:53+00:00)
Title: Fix parsing when messages contain UTF-8.

From https://github.com/stephen/httplike/pull/7, quoting:

> [This] may be the fix for https://github.com/stephen/airsonos/issues/38, but it's possible the reporters there are seeing a different issue.
>
> The situation for me was that I tried to connect the default system audio output to AirSonos, which resulted in the failure popup, but also the following output on the console:
>
> Received unknown RTSP method:
>
> This was caused by the SETUP request. In the parsed request, the method was empty, and the request line actually ended up as the first header line. AirSonos then of course responds with 400.
>
> Root cause was because my Mac is named "Stéphan's iMac", which is inserted in the `ANNOUNCE` right before the `SETUP`. This caused message splitting to break and the `SETUP` message to contain an extra newline at the start, which was actually part of the `ANNOUNCE` SDP.

I also adjusted the original patch to not touch the if-statements, and basically minimized changes.

Tests pass.