]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.c
+ guess mimetype by template extension
[citadel.git] / webcit / webcit.c
index d63afdd64db3ae36b6b1b82acb565c10c2bac02e..3904d043199465dc1ed46c2fee4b220423972526 100644 (file)
@@ -368,11 +368,12 @@ void blank_page(void) {
  * A template has been requested
  */
 void url_do_template(void) {
+       const StrBuf *MimeType;
        const StrBuf *Tmpl = sbstr("template");
        begin_burst();
-       output_headers(1, 0, 0, 0, 1, 0);
-       DoTemplate(SKEY(Tmpl), NULL, &NoCtx);
-       end_burst();
+       output_headers(0, 0, 0, 0, 1, 0);
+       MimeType = DoTemplate(SKEY(Tmpl), NULL, &NoCtx);
+       http_transmit_thing(ChrPtr(MimeType), 0);
 }
 
 
@@ -1039,6 +1040,7 @@ SKIP_ALL_THIS_CRAP:
                WCC->upload_length = 0;
        }
        FreeStrBuf(&WCC->trailing_javascript);
+       WCC->http_host = NULL;
 }