Force downloads to use a MIME type of application/octet-stream
authorArt Cancro <ajc@citadel.org>
Wed, 28 Feb 2007 22:54:52 +0000 (22:54 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 28 Feb 2007 22:54:52 +0000 (22:54 +0000)
in order to prevent downloading browsers from trying to render contents
inline.

webcit/downloads.c

index a1d2984c459615e8e0ef53f453f92f9527cdc60e..4a2352d700fe7335bd538955c2b37692710b8c8e 100644 (file)
@@ -61,7 +61,9 @@ void download_file(char *filename)
        off_t bytes;
        char content_type[256];
        char *content = NULL;
-       int force_download = 0;
+
+       /* Setting to nonzero forces a MIME type of application/octet-stream */
+       int force_download = 1;
        
        serv_printf("OPEN %s", filename);
        serv_getln(buf, sizeof buf);