dinatra
dinatra copied to clipboard
Static files linked from HTML not working
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.
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.