airsonic / airsonic

:satellite: :cloud: :notes:Airsonic, a Free and Open Source community driven media server (fork of Subsonic and Libresonic)
https://airsonic.github.io
GNU General Public License v3.0
2.01k stars 235 forks source link

Incorrect response headers set by DownloadController/StreamController (violates RFC specs) #1448

Open randomnicode opened 4 years ago

randomnicode commented 4 years ago

Likely might be true for other controllers too, just haven't gotten to it yet.

A solution is proposed here at the airsonic-advanced fork (along with other optimizations and streamlining): https://github.com/airsonic-advanced/airsonic-advanced/pull/52

In lieu of, you could also probably get away with just adding and fixing the Content-Range response headers (just add a "/*" at the end for unknown lengths), switching the ETags to use a different representation (like file size), and fixing the media types to something coherent

randomnicode commented 4 years ago

Going to update the same topic after my review of StreamController, which again violates RFC 7233:

This should be instead returning a full 200 OK response. Byte offsets shouldn't be treated in the same way as second offsets, particularly as a parameter field. The Ranges header is meant to be extensible for units other than bytes (needs to be registered at IANA), but it needs to come from the client. In either scenario, returning 206 Partial Content when client doesn't send Ranges is not legal.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.