dinatra icon indicating copy to clipboard operation
dinatra copied to clipboard

Static files linked from HTML not working

Open olaven opened this issue 4 years ago • 1 comments

I am serving HTML statically, and the HTML includes a script-tag, e.g.: <script src="./client.js" type="module"></script>

./client.js is a file in the public directory, so my understanding is that this should work. However, Dinatra handles this as a standard response, not a static response. Because of this, appropriate content-type header is not set, and the browser does not load the file.

olaven avatar Apr 24 '20 11:04 olaven

I have implemented a working (but not good enough) fix in the linked PR. I am very much looking for input, as I'm not sure how to approach this.

olaven avatar Apr 24 '20 11:04 olaven