Fossil SCM

Improvements to the /test_env page that can be used to help diagnose problems such as missing CONTENT_LENGTH CGI parameters.

drh 2024-04-16 13:50 trunk
Commit 9c40ddbcd182f2645a0376858a66bf26c2d5acb1ebe66430e13da838eb034605
2 files changed +1 +5 -1
+1
--- src/cgi.c
+++ src/cgi.c
@@ -1767,10 +1767,11 @@
17671767
"FOSSIL_USER", "SQLITE_TMPDIR", "TMPDIR",
17681768
"TEMP", "TMP", "FOSSIL_VFS",
17691769
"FOSSIL_FORCE_TICKET_MODERATION", "FOSSIL_FORCE_WIKI_MODERATION",
17701770
"FOSSIL_TCL_PATH", "TH1_DELETE_INTERP", "TH1_ENABLE_DOCS",
17711771
"TH1_ENABLE_HOOKS", "TH1_ENABLE_TCL", "REMOTE_HOST",
1772
+ "CONTENT_TYPE", "CONTENT_LENGTH",
17721773
};
17731774
int i;
17741775
for(i=0; i<count(azCgiVars); i++) (void)P(azCgiVars[i]);
17751776
}
17761777
17771778
--- src/cgi.c
+++ src/cgi.c
@@ -1767,10 +1767,11 @@
1767 "FOSSIL_USER", "SQLITE_TMPDIR", "TMPDIR",
1768 "TEMP", "TMP", "FOSSIL_VFS",
1769 "FOSSIL_FORCE_TICKET_MODERATION", "FOSSIL_FORCE_WIKI_MODERATION",
1770 "FOSSIL_TCL_PATH", "TH1_DELETE_INTERP", "TH1_ENABLE_DOCS",
1771 "TH1_ENABLE_HOOKS", "TH1_ENABLE_TCL", "REMOTE_HOST",
 
1772 };
1773 int i;
1774 for(i=0; i<count(azCgiVars); i++) (void)P(azCgiVars[i]);
1775 }
1776
1777
--- src/cgi.c
+++ src/cgi.c
@@ -1767,10 +1767,11 @@
1767 "FOSSIL_USER", "SQLITE_TMPDIR", "TMPDIR",
1768 "TEMP", "TMP", "FOSSIL_VFS",
1769 "FOSSIL_FORCE_TICKET_MODERATION", "FOSSIL_FORCE_WIKI_MODERATION",
1770 "FOSSIL_TCL_PATH", "TH1_DELETE_INTERP", "TH1_ENABLE_DOCS",
1771 "TH1_ENABLE_HOOKS", "TH1_ENABLE_TCL", "REMOTE_HOST",
1772 "CONTENT_TYPE", "CONTENT_LENGTH",
1773 };
1774 int i;
1775 for(i=0; i<count(azCgiVars); i++) (void)P(azCgiVars[i]);
1776 }
1777
1778
+5 -1
--- src/style.c
+++ src/style.c
@@ -1398,11 +1398,11 @@
13981398
** the error message is shown.
13991399
**
14001400
** If zFormat is an empty string, then this is the /test_env page.
14011401
*/
14021402
void webpage_error(const char *zFormat, ...){
1403
- int showAll;
1403
+ int showAll = 0;
14041404
char *zErr = 0;
14051405
int isAuth = 0;
14061406
char zCap[100];
14071407
14081408
login_check_credentials();
@@ -1495,10 +1495,14 @@
14951495
}
14961496
@ <hr>
14971497
P("HTTP_USER_AGENT");
14981498
P("SERVER_SOFTWARE");
14991499
cgi_print_all(showAll, 0, 0);
1500
+ @ <p><form method="POST" action="%R/test_env">
1501
+ @ <input type="hidden" name="showall" value="%d(showAll)">
1502
+ @ <input type="submit" name="post-test-button" value="POST Test">
1503
+ @ </form>
15001504
if( showAll && blob_size(&g.httpHeader)>0 ){
15011505
@ <hr>
15021506
@ <pre>
15031507
@ %h(blob_str(&g.httpHeader))
15041508
@ </pre>
15051509
--- src/style.c
+++ src/style.c
@@ -1398,11 +1398,11 @@
1398 ** the error message is shown.
1399 **
1400 ** If zFormat is an empty string, then this is the /test_env page.
1401 */
1402 void webpage_error(const char *zFormat, ...){
1403 int showAll;
1404 char *zErr = 0;
1405 int isAuth = 0;
1406 char zCap[100];
1407
1408 login_check_credentials();
@@ -1495,10 +1495,14 @@
1495 }
1496 @ <hr>
1497 P("HTTP_USER_AGENT");
1498 P("SERVER_SOFTWARE");
1499 cgi_print_all(showAll, 0, 0);
 
 
 
 
1500 if( showAll && blob_size(&g.httpHeader)>0 ){
1501 @ <hr>
1502 @ <pre>
1503 @ %h(blob_str(&g.httpHeader))
1504 @ </pre>
1505
--- src/style.c
+++ src/style.c
@@ -1398,11 +1398,11 @@
1398 ** the error message is shown.
1399 **
1400 ** If zFormat is an empty string, then this is the /test_env page.
1401 */
1402 void webpage_error(const char *zFormat, ...){
1403 int showAll = 0;
1404 char *zErr = 0;
1405 int isAuth = 0;
1406 char zCap[100];
1407
1408 login_check_credentials();
@@ -1495,10 +1495,14 @@
1495 }
1496 @ <hr>
1497 P("HTTP_USER_AGENT");
1498 P("SERVER_SOFTWARE");
1499 cgi_print_all(showAll, 0, 0);
1500 @ <p><form method="POST" action="%R/test_env">
1501 @ <input type="hidden" name="showall" value="%d(showAll)">
1502 @ <input type="submit" name="post-test-button" value="POST Test">
1503 @ </form>
1504 if( showAll && blob_size(&g.httpHeader)>0 ){
1505 @ <hr>
1506 @ <pre>
1507 @ %h(blob_str(&g.httpHeader))
1508 @ </pre>
1509

Keyboard Shortcuts

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