mdsrv icon indicating copy to clipboard operation
mdsrv copied to clipboard

mdsrv REST API responses have default Content-Type header 'text/html'

Open ismaelresp opened this issue 7 years ago • 3 comments

The mdsrv REST API commands that do not trigger a file download generate responses with 'text/html' Content-Type (mimetype) header. This content-types does not match the given output.

I recommend adding the following content-types:

  • mdsrv/dir: 'application/json'
  • mdsrv/traj/numframes: 'text/plain; charset="UTF-8"'
  • mdsrv/traj/frame: 'application/octet-stream'
  • mdsrv/traj/path: 'application/octet-stream'

This content-type mismatches cause conflicts when the reponse is not direclty handled by the ngl viewer (e.g. intermediate proxies, debuggers, third-party applications, etc.) especially when binary data is processed as text.

ismaelresp avatar Mar 16 '17 19:03 ismaelresp

thanks, I fully agree

arose avatar Mar 16 '17 21:03 arose

@j0kaso is this something you could look into?

arose avatar Mar 16 '17 21:03 arose

Yupp, I'll look into it.

j0kaso avatar Mar 21 '17 16:03 j0kaso