atom / atom-languageclient

Language Server Protocol support for Atom (the basis of Atom-IDE)
https://ide.atom.io/
MIT License
388 stars 78 forks source link

DownloadFile is not able to use content-length header #190

Closed henryju closed 6 years ago

henryju commented 6 years ago

Contrary to the documentation, it seems you are always forced to manually pass the file length. The code trying to read the Content-Length header is not working. My little understanding (and after lot of debugging) is that fetch is doing a "cors" mode request, and Content-Length is not whitelisted in this mode.

damieng commented 6 years ago

Yes, it looks like the server needs to send an extra header to enable this;

Access-Control-Expose-Headers "content-length"

I'll add that to the docs - I don't see a way to avoid it unfortunately.