Fossil SCM

Allow the mimetype query parameter for non-CGI content in /ext.

drh 2025-08-13 15:48 trunk
Commit 639b96b9ad54dbffe489cc020f052845fda839bcc3a0aecf39d3db3d2f98e7fb
1 file changed +2 -1
+2 -1
--- src/extcgi.c
+++ src/extcgi.c
@@ -229,11 +229,12 @@
229229
zFailReason = "path does not match any file or script";
230230
goto ext_not_found;
231231
}
232232
assert( nScript>=nRoot+1 );
233233
style_set_current_page("ext/%s", &zScript[nRoot+1]);
234
- zMime = mimetype_from_name(zScript);
234
+ zMime = P("mimetype");
235
+ if( zMime==0 ) zMime = mimetype_from_name(zScript);
235236
if( zMime==0 ) zMime = "application/octet-stream";
236237
if( !file_isexe(zScript, ExtFILE) ){
237238
/* File is not executable. Must be a regular file. In that case,
238239
** disallow extra path elements */
239240
if( zPath[nScript]!=0 ){
240241
--- src/extcgi.c
+++ src/extcgi.c
@@ -229,11 +229,12 @@
229 zFailReason = "path does not match any file or script";
230 goto ext_not_found;
231 }
232 assert( nScript>=nRoot+1 );
233 style_set_current_page("ext/%s", &zScript[nRoot+1]);
234 zMime = mimetype_from_name(zScript);
 
235 if( zMime==0 ) zMime = "application/octet-stream";
236 if( !file_isexe(zScript, ExtFILE) ){
237 /* File is not executable. Must be a regular file. In that case,
238 ** disallow extra path elements */
239 if( zPath[nScript]!=0 ){
240
--- src/extcgi.c
+++ src/extcgi.c
@@ -229,11 +229,12 @@
229 zFailReason = "path does not match any file or script";
230 goto ext_not_found;
231 }
232 assert( nScript>=nRoot+1 );
233 style_set_current_page("ext/%s", &zScript[nRoot+1]);
234 zMime = P("mimetype");
235 if( zMime==0 ) zMime = mimetype_from_name(zScript);
236 if( zMime==0 ) zMime = "application/octet-stream";
237 if( !file_isexe(zScript, ExtFILE) ){
238 /* File is not executable. Must be a regular file. In that case,
239 ** disallow extra path elements */
240 if( zPath[nScript]!=0 ){
241

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button