livepeer / catalyst-api

MIT License
4 stars 2 forks source link

mapic: Fix multistream target URL `?` handling #1300

Closed victorges closed 2 months ago

victorges commented 4 months ago

It turns out that Mist has a special parsing of these push URLs which is not a regular URL parsing. It removes anything after the last ? in the URL and uses that as its config. If there are multiple ? in the URL (e.g. query-string already existed in target URL), it will strip only (from) the last one and keep the previous.

So instead of merging Mist's qs with the existing ones, we actually need to create a separate ? section for Mist. This guarantees both that Mist gets its config properly, as well as that it preserves the URL to call the target service.

thomshutt commented 4 months ago

Could you add some unit tests to make this easier to reason about please?