Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change message encoding to support URLs with ? (#47)
Before this change, if I request to play the URL http://192.168.0.10/test.mp3?auth%3Dsomething through Home Assistant, it will result in this message being sent: heos://browse/play_stream?sequence=498&pid=-646915758&url=http://192.168.0.10/test.mp3?auth%3Dsomething but despite saying in CLI specification that special characters in arguments need to be encoded, HEOS seems to take the url argument and pass it to the stream server verbatim, as demonstrated by the nginx log resulting from this command: Jan 04 12:03:27 lillia nginx[351316]: lillia nginx: 192.168.0.209 - - [04/Jan/2025:12:03:27 +0100] "GET /test.mp3?auth%3Dsomething HTTP/1.1" 404 146 "-" "AvegaMediaServer/2.0 Linux/2.6" I've been playing URLs with ? in them for some months now by inserting them into the HEOS command without quoting them, for example: heos://browse/play_stream?sequence=498&pid=-646915758&url=http://192.168.0.10/test.mp3?auth=something This seems to be consistent with the requirement that url be the last argument, because then the controller can treat the rest of the command as URL without processing it. This change introduces special handling of the url argument, so that it bypasses quoting in addition to being the last argument.
- Loading branch information