Skip to content

Commit f83d31d

Browse files
authored
Merge pull request #38689 from nextcloud/backport/38688/stable27
[stable27] fix(apache): Serve `mjs` (module javascript) as static files
2 parents c615681 + 31d5f72 commit f83d31d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</IfModule>
4141

4242
# Add cache control for static resources
43-
<FilesMatch "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite)$">
43+
<FilesMatch "\.(css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite)$">
4444
<If "%{QUERY_STRING} =~ /(^|&)v=/">
4545
Header set Cache-Control "max-age=15778463, immutable"
4646
</If>

lib/private/Setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ public static function updateHtaccess() {
529529
$content .= "\n Options -MultiViews";
530530
$content .= "\n RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]";
531531
$content .= "\n RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]";
532-
$content .= "\n RewriteCond %{REQUEST_FILENAME} !\\.(css|js|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4|mp3|ogg|wav|wasm|tflite)$";
532+
$content .= "\n RewriteCond %{REQUEST_FILENAME} !\\.(css|js|mjs|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4|mp3|ogg|wav|wasm|tflite)$";
533533
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/core/ajax/update\\.php";
534534
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/core/img/(favicon\\.ico|manifest\\.json)$";
535535
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/(cron|public|remote|status)\\.php";

0 commit comments

Comments
 (0)