Fossil SCM
Allow the mimetype query parameter for non-CGI content in /ext.
Commit
639b96b9ad54dbffe489cc020f052845fda839bcc3a0aecf39d3db3d2f98e7fb
Parent
c6265bb3a7eb867…
1 file changed
+2
-1
+2
-1
| --- src/extcgi.c | ||
| +++ src/extcgi.c | ||
| @@ -229,11 +229,12 @@ | ||
| 229 | 229 | zFailReason = "path does not match any file or script"; |
| 230 | 230 | goto ext_not_found; |
| 231 | 231 | } |
| 232 | 232 | assert( nScript>=nRoot+1 ); |
| 233 | 233 | 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); | |
| 235 | 236 | if( zMime==0 ) zMime = "application/octet-stream"; |
| 236 | 237 | if( !file_isexe(zScript, ExtFILE) ){ |
| 237 | 238 | /* File is not executable. Must be a regular file. In that case, |
| 238 | 239 | ** disallow extra path elements */ |
| 239 | 240 | if( zPath[nScript]!=0 ){ |
| 240 | 241 |
| --- 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 |