Check-in [f969b6cdde]
Not logged in
Overview

SHA1 Hash:f969b6cddeb051079343396dc0a39c35786c1acf
Date: 2009-09-22 11:15:17
User: drh
Comment:Add the optional mimetype= query parameter to the /doc URI.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/doc.c from [4e90952b00] to [cb0906ed17].

@@ -316,10 +316,11 @@
 }
 
 /*
 ** WEBPAGE: doc
 ** URL: /doc?name=BASELINE/PATH
+** URL: /doc/BASELINE/PATH
 **
 ** BASELINE can be either a baseline uuid prefix or magic words "tip"
 ** to me the most recently checked in baseline or "ckout" to mean the
 ** content of the local checkout, if any.  PATH is the relative pathname
 ** of some file.  This method returns the file content.
@@ -438,11 +439,14 @@
   }
 
   /* The file is now contained in the filebody blob.  Deliver the
   ** file to the user
   */
-  zMime = mimetype_from_name(zName);
+  zMime = P("mimetype");
+  if( zMime==0 ){
+    zMime = mimetype_from_name(zName);
+  }
   if( strcmp(zMime, "application/x-fossil-wiki")==0 ){
     Blob title, tail;
     if( wiki_find_title(&filebody, &title, &tail) ){
       style_header(blob_str(&title));
       wiki_convert(&tail, 0, 0);