Fossil SCM

Fix sorting of /ajax/X routes - a recent addition broke preview in /chat and /fileedit.

stephan 2026-06-08 14:25 UTC forum-editor-2026
Commit d14ee6c4fee0bdd2d3c8031d20e580790e1d2fd5ad57845e186dd864150ff305
1 file changed +2 -2
+2 -2
--- src/ajax.c
+++ src/ajax.c
@@ -448,10 +448,11 @@
448448
const char * zName = P("name");
449449
AjaxRoute routeName = {0,0,0,0};
450450
const AjaxRoute * pRoute = 0;
451451
const AjaxRoute routes[] = {
452452
/* Keep these sorted by zName (for bsearch()) */
453
+ {"artifact.json", ajax_route_artifact_json, 0, 0},
453454
{"preview-text", ajax_route_preview_text, 0, 1
454455
/* Preview does not require write permissions in the repo. It
455456
** should arguably require write permissions simply to limit abuse
456457
** but doing means that /chat does not work without check-in
457458
** permissions:
@@ -458,12 +459,11 @@
458459
**
459460
** https://fossil-scm.org/forum/forumpost/ed4a762b3a557898
460461
**
461462
** This particular route is used by /fileedit and /chat, whereas
462463
** /wikiedit uses a simpler wiki-specific route.
463
- */ },
464
- {"artifact.json", ajax_route_artifact_json, 0, 0}
464
+ */ }
465465
};
466466
467467
if(zName==0 || zName[0]==0){
468468
ajax_route_error(400,"Missing required [route] 'name' parameter.");
469469
return;
470470
--- 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

Keyboard Shortcuts

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