Fossil SCM
Minor improvement to the "are we in JSON mode so we can disable the name parameter hack?" pre-check.
Commit
5ea759f9fe8e650f85000365dae5129fb30799a4
Parent
75461b993e85b80…
1 file changed
+1
-1
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1336,11 +1336,11 @@ | ||
| 1336 | 1336 | ** Workaround to allow us to customize some following behaviour for |
| 1337 | 1337 | ** JSON mode. The problem is, we don't always know if we're in JSON |
| 1338 | 1338 | ** mode at this point (namely, for GET mode we don't know but POST |
| 1339 | 1339 | ** we do), so we snoop g.zPath and cheat a bit. |
| 1340 | 1340 | */ |
| 1341 | - if( g.zPath && (0==strcmp("json",g.zPath)) ){ | |
| 1341 | + if( !g.json.isJsonMode && g.zPath && (0==strncmp("json",g.zPath,4)) ){ | |
| 1342 | 1342 | g.json.isJsonMode = 1; |
| 1343 | 1343 | } |
| 1344 | 1344 | #endif |
| 1345 | 1345 | if( g.zExtra ){ |
| 1346 | 1346 | /* CGI parameters get this treatment elsewhere, but places like getfile |
| 1347 | 1347 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1336,11 +1336,11 @@ | |
| 1336 | ** Workaround to allow us to customize some following behaviour for |
| 1337 | ** JSON mode. The problem is, we don't always know if we're in JSON |
| 1338 | ** mode at this point (namely, for GET mode we don't know but POST |
| 1339 | ** we do), so we snoop g.zPath and cheat a bit. |
| 1340 | */ |
| 1341 | if( g.zPath && (0==strcmp("json",g.zPath)) ){ |
| 1342 | g.json.isJsonMode = 1; |
| 1343 | } |
| 1344 | #endif |
| 1345 | if( g.zExtra ){ |
| 1346 | /* CGI parameters get this treatment elsewhere, but places like getfile |
| 1347 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1336,11 +1336,11 @@ | |
| 1336 | ** Workaround to allow us to customize some following behaviour for |
| 1337 | ** JSON mode. The problem is, we don't always know if we're in JSON |
| 1338 | ** mode at this point (namely, for GET mode we don't know but POST |
| 1339 | ** we do), so we snoop g.zPath and cheat a bit. |
| 1340 | */ |
| 1341 | if( !g.json.isJsonMode && g.zPath && (0==strncmp("json",g.zPath,4)) ){ |
| 1342 | g.json.isJsonMode = 1; |
| 1343 | } |
| 1344 | #endif |
| 1345 | if( g.zExtra ){ |
| 1346 | /* CGI parameters get this treatment elsewhere, but places like getfile |
| 1347 |