Fossil SCM

Removed the special-cased addition of g.zExtra==parameter named "name" when running in JSON mode because it causes no end of grief in several JSON handlers and none of the handlers rely on that handling.

stephan 2012-03-18 02:15 trunk
Commit ccd6c879b4442c57acbf95118f0b7371613645a7
1 file changed +14 -2
+14 -2
--- src/main.c
+++ src/main.c
@@ -1310,13 +1310,25 @@
13101310
if( g.zExtra ){
13111311
/* CGI parameters get this treatment elsewhere, but places like getfile
13121312
** will use g.zExtra directly.
13131313
** Reminder: the login mechanism uses 'name' differently, and may
13141314
** eventually have a problem/collision with this.
1315
+ **
1316
+ ** Disabled by stephan when running in JSON mode because this
1317
+ ** particular parameter name is very common and i have had no end
1318
+ ** of grief with this handling. The JSON API never relies on the
1319
+ ** handling below, and by disabling it in JSON mode i can remove
1320
+ ** lots of special-case handling in several JSON handlers.
13151321
*/
1316
- dehttpize(g.zExtra);
1317
- cgi_set_parameter_nocopy("name", g.zExtra);
1322
+#ifdef FOSSIL_ENABLE_JSON
1323
+ if(!g.json.isJsonMode){
1324
+#endif
1325
+ dehttpize(g.zExtra);
1326
+ cgi_set_parameter_nocopy("name", g.zExtra);
1327
+#ifdef FOSSIL_ENABLE_JSON
1328
+ }
1329
+#endif
13181330
}
13191331
13201332
/* Locate the method specified by the path and execute the function
13211333
** that implements that method.
13221334
*/
13231335
--- src/main.c
+++ src/main.c
@@ -1310,13 +1310,25 @@
1310 if( g.zExtra ){
1311 /* CGI parameters get this treatment elsewhere, but places like getfile
1312 ** will use g.zExtra directly.
1313 ** Reminder: the login mechanism uses 'name' differently, and may
1314 ** eventually have a problem/collision with this.
 
 
 
 
 
 
1315 */
1316 dehttpize(g.zExtra);
1317 cgi_set_parameter_nocopy("name", g.zExtra);
 
 
 
 
 
 
1318 }
1319
1320 /* Locate the method specified by the path and execute the function
1321 ** that implements that method.
1322 */
1323
--- src/main.c
+++ src/main.c
@@ -1310,13 +1310,25 @@
1310 if( g.zExtra ){
1311 /* CGI parameters get this treatment elsewhere, but places like getfile
1312 ** will use g.zExtra directly.
1313 ** Reminder: the login mechanism uses 'name' differently, and may
1314 ** eventually have a problem/collision with this.
1315 **
1316 ** Disabled by stephan when running in JSON mode because this
1317 ** particular parameter name is very common and i have had no end
1318 ** of grief with this handling. The JSON API never relies on the
1319 ** handling below, and by disabling it in JSON mode i can remove
1320 ** lots of special-case handling in several JSON handlers.
1321 */
1322 #ifdef FOSSIL_ENABLE_JSON
1323 if(!g.json.isJsonMode){
1324 #endif
1325 dehttpize(g.zExtra);
1326 cgi_set_parameter_nocopy("name", g.zExtra);
1327 #ifdef FOSSIL_ENABLE_JSON
1328 }
1329 #endif
1330 }
1331
1332 /* Locate the method specified by the path and execute the function
1333 ** that implements that method.
1334 */
1335

Keyboard Shortcuts

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