Closed patrickjuchli closed 8 years ago
Thank you for pointing this out, I didn't realize it's a SHOULD for a HEAD request. A way to fix it is to replace the HEAD request with a GET using a Range request. This is needed to read tags that are located at the end of the file.
I've just updated the npm package, can you please give it a try?
Works great, I'm using the config to disable HEAD requests at all. Many thanks!
I'm using the library in the browser and I'd like to see the tags of MP3 files. Doing so leads to the following error:
GET http://localhost:3001/sound/stella.mp3 416 (Requested Range Not Satisfiable)
This happens because the requested range is [NaN, NaN]. After a quick first debug session I think this is caused by the size of the file being reported as NaN. In the XHRFileReader you send a HEAD request in order to get the file size using Content-Length in the response header. Not all servers return Content-Length after a HEAD request, though. See RFC 7231:
SOULD, not MUST. In my case, there is no such information and thus the rest fails. I "verified" this by replacing the parseInt() expression with a constant number. The line in question is:
self._size = parseInt(xhr.getResponseHeader("Content-Length"), 10);
How should this be fixed correctly? Why do you need the file size? (I don't know much about ID3 tags, hence these questions)