server: fix allowed extension regexp, explicitely allow mjs src files

This commit is contained in:
jean-emmanuel 2026-08-30 17:18:27 +02:00
parent db85c42989
commit 3263cf2ff1

View file

@ -244,7 +244,8 @@ class WebServer extends EventEmitter {
url = url.replace('_:_', ':') // escaped drive colon
url = url.replace(/^\/([^/]*:)/, '$1') // strip leading slash
if (url.match(/.(svg|jpg|jpeg|png|apng|gif|webp|tiff|xbm|bmp|ico|ttf|otf|woff|woff2|html|css|js)(\?[0-9]*)?$/i)) {
if (url.match(/\.(svg|jpg|jpeg|png|apng|gif|webp|tiff|xbm|bmp|ico|ttf|otf|woff|woff2|html|css|js)(\?[0-9]*)?$/i) ||
url.match(/\.mjs$/) && !this.prod) {
// Resolution order: session path, theme path, absolute path
var id