milaq / YCast

Self hosted vTuner internet radio service emulation
Other
243 stars 93 forks source link

Fix redirects for some AVR models #19

Open milaq opened 5 years ago

milaq commented 5 years ago

Some AVR models don't follow 302 redirects for some reason.

milaq commented 5 years ago

First try on finding out what works and what doesn't: https://github.com/milaq/YCast/tree/redirect_shenanigans

milaq commented 5 years ago

Also see https://github.com/milaq/YCast/commit/1b4ba071b7f27cf853ca572a5ed1dbb9d090494d

milaq commented 5 years ago

https://github.com/milaq/YCast/commit/053bdfa5fabe80d10bdb690488c6dcd10fe306ac is working.

It seems like some Yamaha AVRs have a built-in whitelist and are discarding any non-matching redirects.

I reckon that the receiver just checks the Baseurl of the request (i.e. http://radioyamaha.vtuner.com).

milaq commented 5 years ago

Assumption confirmed.

Some Yamaha AVRs only accept redirects if the headers include http://radioyamaha.vtuner.com.

milaq commented 5 years ago

Maybe the whitelist checks something like this:

If HOST or REFERER or ORIGIN begins with http://radioyamaha.vtuner.com then pass

milaq commented 4 years ago

We should implement vendor specific url overrides to mitigate the issue some users are having with some AVRs which put the wrong information into the host header.

milaq commented 4 years ago

See https://github.com/milaq/YCast/issues/50