Fossil SCM
Fix sorting of /ajax/X routes - a recent addition broke preview in /chat and /fileedit.
Commit
d14ee6c4fee0bdd2d3c8031d20e580790e1d2fd5ad57845e186dd864150ff305
Parent
16e97eaefffd13c…
1 file changed
+2
-2
+2
-2
| --- src/ajax.c | ||
| +++ src/ajax.c | ||
| @@ -448,10 +448,11 @@ | ||
| 448 | 448 | const char * zName = P("name"); |
| 449 | 449 | AjaxRoute routeName = {0,0,0,0}; |
| 450 | 450 | const AjaxRoute * pRoute = 0; |
| 451 | 451 | const AjaxRoute routes[] = { |
| 452 | 452 | /* Keep these sorted by zName (for bsearch()) */ |
| 453 | + {"artifact.json", ajax_route_artifact_json, 0, 0}, | |
| 453 | 454 | {"preview-text", ajax_route_preview_text, 0, 1 |
| 454 | 455 | /* Preview does not require write permissions in the repo. It |
| 455 | 456 | ** should arguably require write permissions simply to limit abuse |
| 456 | 457 | ** but doing means that /chat does not work without check-in |
| 457 | 458 | ** permissions: |
| @@ -458,12 +459,11 @@ | ||
| 458 | 459 | ** |
| 459 | 460 | ** https://fossil-scm.org/forum/forumpost/ed4a762b3a557898 |
| 460 | 461 | ** |
| 461 | 462 | ** This particular route is used by /fileedit and /chat, whereas |
| 462 | 463 | ** /wikiedit uses a simpler wiki-specific route. |
| 463 | - */ }, | |
| 464 | - {"artifact.json", ajax_route_artifact_json, 0, 0} | |
| 464 | + */ } | |
| 465 | 465 | }; |
| 466 | 466 | |
| 467 | 467 | if(zName==0 || zName[0]==0){ |
| 468 | 468 | ajax_route_error(400,"Missing required [route] 'name' parameter."); |
| 469 | 469 | return; |
| 470 | 470 |
| --- src/ajax.c | |
| +++ src/ajax.c | |
| @@ -448,10 +448,11 @@ | |
| 448 | const char * zName = P("name"); |
| 449 | AjaxRoute routeName = {0,0,0,0}; |
| 450 | const AjaxRoute * pRoute = 0; |
| 451 | const AjaxRoute routes[] = { |
| 452 | /* Keep these sorted by zName (for bsearch()) */ |
| 453 | {"preview-text", ajax_route_preview_text, 0, 1 |
| 454 | /* Preview does not require write permissions in the repo. It |
| 455 | ** should arguably require write permissions simply to limit abuse |
| 456 | ** but doing means that /chat does not work without check-in |
| 457 | ** permissions: |
| @@ -458,12 +459,11 @@ | |
| 458 | ** |
| 459 | ** https://fossil-scm.org/forum/forumpost/ed4a762b3a557898 |
| 460 | ** |
| 461 | ** This particular route is used by /fileedit and /chat, whereas |
| 462 | ** /wikiedit uses a simpler wiki-specific route. |
| 463 | */ }, |
| 464 | {"artifact.json", ajax_route_artifact_json, 0, 0} |
| 465 | }; |
| 466 | |
| 467 | if(zName==0 || zName[0]==0){ |
| 468 | ajax_route_error(400,"Missing required [route] 'name' parameter."); |
| 469 | return; |
| 470 |
| --- src/ajax.c | |
| +++ src/ajax.c | |
| @@ -448,10 +448,11 @@ | |
| 448 | const char * zName = P("name"); |
| 449 | AjaxRoute routeName = {0,0,0,0}; |
| 450 | const AjaxRoute * pRoute = 0; |
| 451 | const AjaxRoute routes[] = { |
| 452 | /* Keep these sorted by zName (for bsearch()) */ |
| 453 | {"artifact.json", ajax_route_artifact_json, 0, 0}, |
| 454 | {"preview-text", ajax_route_preview_text, 0, 1 |
| 455 | /* Preview does not require write permissions in the repo. It |
| 456 | ** should arguably require write permissions simply to limit abuse |
| 457 | ** but doing means that /chat does not work without check-in |
| 458 | ** permissions: |
| @@ -458,12 +459,11 @@ | |
| 459 | ** |
| 460 | ** https://fossil-scm.org/forum/forumpost/ed4a762b3a557898 |
| 461 | ** |
| 462 | ** This particular route is used by /fileedit and /chat, whereas |
| 463 | ** /wikiedit uses a simpler wiki-specific route. |
| 464 | */ } |
| 465 | }; |
| 466 | |
| 467 | if(zName==0 || zName[0]==0){ |
| 468 | ajax_route_error(400,"Missing required [route] 'name' parameter."); |
| 469 | return; |
| 470 |