Fossil SCM

Minor improvement to the "are we in JSON mode so we can disable the name parameter hack?" pre-check.

stephan 2012-07-03 21:28 trunk
Commit 5ea759f9fe8e650f85000365dae5129fb30799a4
1 file changed +1 -1
+1 -1
--- src/main.c
+++ src/main.c
@@ -1336,11 +1336,11 @@
13361336
** Workaround to allow us to customize some following behaviour for
13371337
** JSON mode. The problem is, we don't always know if we're in JSON
13381338
** mode at this point (namely, for GET mode we don't know but POST
13391339
** we do), so we snoop g.zPath and cheat a bit.
13401340
*/
1341
- if( g.zPath && (0==strcmp("json",g.zPath)) ){
1341
+ if( !g.json.isJsonMode && g.zPath && (0==strncmp("json",g.zPath,4)) ){
13421342
g.json.isJsonMode = 1;
13431343
}
13441344
#endif
13451345
if( g.zExtra ){
13461346
/* CGI parameters get this treatment elsewhere, but places like getfile
13471347
--- 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

Keyboard Shortcuts

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