Fossil SCM
A follow-up patch to the previous "name" change, to work around the problem of HTTP GET requests not yet knowing that they are in JSON mode (POST requests know this).
Commit
3bf1ad01625df042f3c3e75677fead0ca81eee7c
Parent
64721991671aec6…
1 file changed
+11
+11
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1305,10 +1305,21 @@ | ||
| 1305 | 1305 | }else{ |
| 1306 | 1306 | g.zExtra = 0; |
| 1307 | 1307 | } |
| 1308 | 1308 | break; |
| 1309 | 1309 | } |
| 1310 | +#ifdef FOSSIL_ENABLE_JSON | |
| 1311 | + /* | |
| 1312 | + ** Workaround to allow us to customize some following behaviour for | |
| 1313 | + ** JSON mode. The problem is, we don't always know if we're in JSON | |
| 1314 | + ** mode at this point (namely, for GET mode we don't know but POST | |
| 1315 | + ** we do), so we snoop g.zPath and cheat a bit. | |
| 1316 | + */ | |
| 1317 | + if( g.zPath && (0==strcmp("json",g.zPath)) ){ | |
| 1318 | + g.json.isJsonMode = 1; | |
| 1319 | + } | |
| 1320 | +#endif | |
| 1310 | 1321 | if( g.zExtra ){ |
| 1311 | 1322 | /* CGI parameters get this treatment elsewhere, but places like getfile |
| 1312 | 1323 | ** will use g.zExtra directly. |
| 1313 | 1324 | ** Reminder: the login mechanism uses 'name' differently, and may |
| 1314 | 1325 | ** eventually have a problem/collision with this. |
| 1315 | 1326 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1305,10 +1305,21 @@ | |
| 1305 | }else{ |
| 1306 | g.zExtra = 0; |
| 1307 | } |
| 1308 | break; |
| 1309 | } |
| 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 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1305,10 +1305,21 @@ | |
| 1305 | }else{ |
| 1306 | g.zExtra = 0; |
| 1307 | } |
| 1308 | break; |
| 1309 | } |
| 1310 | #ifdef FOSSIL_ENABLE_JSON |
| 1311 | /* |
| 1312 | ** Workaround to allow us to customize some following behaviour for |
| 1313 | ** JSON mode. The problem is, we don't always know if we're in JSON |
| 1314 | ** mode at this point (namely, for GET mode we don't know but POST |
| 1315 | ** we do), so we snoop g.zPath and cheat a bit. |
| 1316 | */ |
| 1317 | if( g.zPath && (0==strcmp("json",g.zPath)) ){ |
| 1318 | g.json.isJsonMode = 1; |
| 1319 | } |
| 1320 | #endif |
| 1321 | if( g.zExtra ){ |
| 1322 | /* CGI parameters get this treatment elsewhere, but places like getfile |
| 1323 | ** will use g.zExtra directly. |
| 1324 | ** Reminder: the login mechanism uses 'name' differently, and may |
| 1325 | ** eventually have a problem/collision with this. |
| 1326 |