Fossil SCM
Add the optional mimetype= query parameter to the /doc URI.
Commit
f969b6cddeb051079343396dc0a39c35786c1acf
Parent
249f1beaece5c6e…
1 file changed
+5
-1
+5
-1
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -316,10 +316,11 @@ | ||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | /* |
| 319 | 319 | ** WEBPAGE: doc |
| 320 | 320 | ** URL: /doc?name=BASELINE/PATH |
| 321 | +** URL: /doc/BASELINE/PATH | |
| 321 | 322 | ** |
| 322 | 323 | ** BASELINE can be either a baseline uuid prefix or magic words "tip" |
| 323 | 324 | ** to me the most recently checked in baseline or "ckout" to mean the |
| 324 | 325 | ** content of the local checkout, if any. PATH is the relative pathname |
| 325 | 326 | ** of some file. This method returns the file content. |
| @@ -438,11 +439,14 @@ | ||
| 438 | 439 | } |
| 439 | 440 | |
| 440 | 441 | /* The file is now contained in the filebody blob. Deliver the |
| 441 | 442 | ** file to the user |
| 442 | 443 | */ |
| 443 | - zMime = mimetype_from_name(zName); | |
| 444 | + zMime = P("mimetype"); | |
| 445 | + if( zMime==0 ){ | |
| 446 | + zMime = mimetype_from_name(zName); | |
| 447 | + } | |
| 444 | 448 | if( strcmp(zMime, "application/x-fossil-wiki")==0 ){ |
| 445 | 449 | Blob title, tail; |
| 446 | 450 | if( wiki_find_title(&filebody, &title, &tail) ){ |
| 447 | 451 | style_header(blob_str(&title)); |
| 448 | 452 | wiki_convert(&tail, 0, 0); |
| 449 | 453 |
| --- 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 |