Fossil SCM

Remove the '; charset=utf-8' suffix from response Content-Type headers. That modifier is technically incorrect for many mimetypes, but wasm loaders are extra picky about it and refuse to load wasm files with the charset set. An attempt at porting over althttpd's solution for this same problem leads down a much deeper and far more invasive rabbit hole because how fossil handles/sets the response content type is more involved than in althttpd.

stephan 2022-06-06 15:51 trunk
Commit 15e7b49ef3277b0638988228c7c8c4670e44ff0fef788fda1d4bc0268375dc6c
1 file changed +1 -1
+1 -1
--- src/cgi.c
+++ src/cgi.c
@@ -493,11 +493,11 @@
493493
494494
/* Content intended for logged in users should only be cached in
495495
** the browser, not some shared location.
496496
*/
497497
if( iReplyStatus!=304 ) {
498
- blob_appendf(&hdr, "Content-Type: %s; charset=utf-8\r\n", zContentType);
498
+ blob_appendf(&hdr, "Content-Type: %s\r\n", zContentType);
499499
if( fossil_strcmp(zContentType,"application/x-fossil")==0 ){
500500
cgi_combine_header_and_body();
501501
blob_compress(&cgiContent[0], &cgiContent[0]);
502502
}
503503
504504
--- src/cgi.c
+++ src/cgi.c
@@ -493,11 +493,11 @@
493
494 /* Content intended for logged in users should only be cached in
495 ** the browser, not some shared location.
496 */
497 if( iReplyStatus!=304 ) {
498 blob_appendf(&hdr, "Content-Type: %s; charset=utf-8\r\n", zContentType);
499 if( fossil_strcmp(zContentType,"application/x-fossil")==0 ){
500 cgi_combine_header_and_body();
501 blob_compress(&cgiContent[0], &cgiContent[0]);
502 }
503
504
--- src/cgi.c
+++ src/cgi.c
@@ -493,11 +493,11 @@
493
494 /* Content intended for logged in users should only be cached in
495 ** the browser, not some shared location.
496 */
497 if( iReplyStatus!=304 ) {
498 blob_appendf(&hdr, "Content-Type: %s\r\n", zContentType);
499 if( fossil_strcmp(zContentType,"application/x-fossil")==0 ){
500 cgi_combine_header_and_body();
501 blob_compress(&cgiContent[0], &cgiContent[0]);
502 }
503
504

Keyboard Shortcuts

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