]> gitweb.ps.run Git - ps-cgit/commitdiff
Don't specify mimetype in ui-blob.c
authorLars Hjemli <hjemli@gmail.com>
Tue, 25 Mar 2008 01:43:51 +0000 (02:43 +0100)
committerLars Hjemli <hjemli@gmail.com>
Tue, 8 Apr 2008 19:35:00 +0000 (21:35 +0200)
But be sure to specify correct filename. This way, the client can hopefully
guess a sensible mimetype based on the filename suffix, and cgit can ignore
the issue altogether.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
ui-blob.c
ui-tree.c

index 11589db2bbc947ea79f651b7855502224f6ebfa9..ab44659a93bb1b66d98ff2bf110de2838e0c39a5 100644 (file)
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -36,7 +36,7 @@ void cgit_print_blob(const char *hex, char *path)
        }
 
        buf[size] = '\0';
-       ctx.page.mimetype = "text/plain";
+       ctx.page.mimetype = NULL;
        ctx.page.filename = path;
        cgit_print_http_headers(&ctx);
        write(htmlfd, buf, size);
index 9be3140c40b7583bfa07a435735f958c6d39b723..2f052c71e13077ca2caed29a419401b39062ed6b 100644 (file)
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -36,7 +36,8 @@ static void print_object(const unsigned char *sha1, char *path)
        }
 
        html(" blob: <a href='");
-       html_attr(cgit_pageurl(ctx.qry.repo, "blob", fmt("id=%s", sha1_to_hex(sha1))));
+       html_attr(cgit_pageurl(ctx.qry.repo, "blob",
+                              fmt("id=%s&path=%s", sha1_to_hex(sha1), path)));
        htmlf("'>%s</a>",sha1_to_hex(sha1));
 
        html("<table summary='blob content' class='blob'>\n");