museumsvictoria / nodel

A digital media control system for museums and galleries
nodel.io
60 stars 17 forks source link

`Range` HTTP header perhaps unnecessarily blocked #324

Open justparking opened 5 months ago

justparking commented 5 months ago

This was experienced when trying to host a MP4 video file.

When using Chrome, it automatically uses this Range: bytes=0- header which seems to trip up Nodel HTTP server.

It returns a misleading error code 404 NOT FOUND but looking deeper in the code, it's actually supposed to return INTERNAL ERROR: 'range' not supported in this context. (related code https://github.com/museumsvictoria/nodel/blob/e0e6500dc576088a84fc619fad9fdc3243f7bd52/nodel-framework/src/main/java/org/nanohttpd/protocols/http/NanoHTTPD.java#L893)

Nodel definitely has code to support (even partially support) the Range header - doco.

I presume browsers make use it to provide file seeking which is different to other content types.

I'm not sure if there was a particular reason why Range was specifically being ignored.

I tested removing that check and it works fine but I need to check for other side-effects.