Fossil SCM

Add the optional mimetype= query parameter to the /doc URI.

drh 2009-09-22 11:15 trunk
Commit f969b6cddeb051079343396dc0a39c35786c1acf
1 file changed +5 -1
+5 -1
--- src/doc.c
+++ src/doc.c
@@ -316,10 +316,11 @@
316316
}
317317
318318
/*
319319
** WEBPAGE: doc
320320
** URL: /doc?name=BASELINE/PATH
321
+** URL: /doc/BASELINE/PATH
321322
**
322323
** BASELINE can be either a baseline uuid prefix or magic words "tip"
323324
** to me the most recently checked in baseline or "ckout" to mean the
324325
** content of the local checkout, if any. PATH is the relative pathname
325326
** of some file. This method returns the file content.
@@ -438,11 +439,14 @@
438439
}
439440
440441
/* The file is now contained in the filebody blob. Deliver the
441442
** file to the user
442443
*/
443
- zMime = mimetype_from_name(zName);
444
+ zMime = P("mimetype");
445
+ if( zMime==0 ){
446
+ zMime = mimetype_from_name(zName);
447
+ }
444448
if( strcmp(zMime, "application/x-fossil-wiki")==0 ){
445449
Blob title, tail;
446450
if( wiki_find_title(&filebody, &title, &tail) ){
447451
style_header(blob_str(&title));
448452
wiki_convert(&tail, 0, 0);
449453
--- src/doc.c
+++ src/doc.c
@@ -316,10 +316,11 @@
316 }
317
318 /*
319 ** WEBPAGE: doc
320 ** URL: /doc?name=BASELINE/PATH
 
321 **
322 ** BASELINE can be either a baseline uuid prefix or magic words "tip"
323 ** to me the most recently checked in baseline or "ckout" to mean the
324 ** content of the local checkout, if any. PATH is the relative pathname
325 ** of some file. This method returns the file content.
@@ -438,11 +439,14 @@
438 }
439
440 /* The file is now contained in the filebody blob. Deliver the
441 ** file to the user
442 */
443 zMime = mimetype_from_name(zName);
 
 
 
444 if( strcmp(zMime, "application/x-fossil-wiki")==0 ){
445 Blob title, tail;
446 if( wiki_find_title(&filebody, &title, &tail) ){
447 style_header(blob_str(&title));
448 wiki_convert(&tail, 0, 0);
449
--- src/doc.c
+++ src/doc.c
@@ -316,10 +316,11 @@
316 }
317
318 /*
319 ** WEBPAGE: doc
320 ** URL: /doc?name=BASELINE/PATH
321 ** URL: /doc/BASELINE/PATH
322 **
323 ** BASELINE can be either a baseline uuid prefix or magic words "tip"
324 ** to me the most recently checked in baseline or "ckout" to mean the
325 ** content of the local checkout, if any. PATH is the relative pathname
326 ** of some file. This method returns the file content.
@@ -438,11 +439,14 @@
439 }
440
441 /* The file is now contained in the filebody blob. Deliver the
442 ** file to the user
443 */
444 zMime = P("mimetype");
445 if( zMime==0 ){
446 zMime = mimetype_from_name(zName);
447 }
448 if( strcmp(zMime, "application/x-fossil-wiki")==0 ){
449 Blob title, tail;
450 if( wiki_find_title(&filebody, &title, &tail) ){
451 style_header(blob_str(&title));
452 wiki_convert(&tail, 0, 0);
453

Keyboard Shortcuts

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