Fossil SCM
Improvements to the /test_env page that can be used to help diagnose problems such as missing CONTENT_LENGTH CGI parameters.
Commit
9c40ddbcd182f2645a0376858a66bf26c2d5acb1ebe66430e13da838eb034605
Parent
3828746b57105d2…
2 files changed
+1
+5
-1
+1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1767,10 +1767,11 @@ | ||
| 1767 | 1767 | "FOSSIL_USER", "SQLITE_TMPDIR", "TMPDIR", |
| 1768 | 1768 | "TEMP", "TMP", "FOSSIL_VFS", |
| 1769 | 1769 | "FOSSIL_FORCE_TICKET_MODERATION", "FOSSIL_FORCE_WIKI_MODERATION", |
| 1770 | 1770 | "FOSSIL_TCL_PATH", "TH1_DELETE_INTERP", "TH1_ENABLE_DOCS", |
| 1771 | 1771 | "TH1_ENABLE_HOOKS", "TH1_ENABLE_TCL", "REMOTE_HOST", |
| 1772 | + "CONTENT_TYPE", "CONTENT_LENGTH", | |
| 1772 | 1773 | }; |
| 1773 | 1774 | int i; |
| 1774 | 1775 | for(i=0; i<count(azCgiVars); i++) (void)P(azCgiVars[i]); |
| 1775 | 1776 | } |
| 1776 | 1777 | |
| 1777 | 1778 |
| --- 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 @@ | ||
| 1398 | 1398 | ** the error message is shown. |
| 1399 | 1399 | ** |
| 1400 | 1400 | ** If zFormat is an empty string, then this is the /test_env page. |
| 1401 | 1401 | */ |
| 1402 | 1402 | void webpage_error(const char *zFormat, ...){ |
| 1403 | - int showAll; | |
| 1403 | + int showAll = 0; | |
| 1404 | 1404 | char *zErr = 0; |
| 1405 | 1405 | int isAuth = 0; |
| 1406 | 1406 | char zCap[100]; |
| 1407 | 1407 | |
| 1408 | 1408 | login_check_credentials(); |
| @@ -1495,10 +1495,14 @@ | ||
| 1495 | 1495 | } |
| 1496 | 1496 | @ <hr> |
| 1497 | 1497 | P("HTTP_USER_AGENT"); |
| 1498 | 1498 | P("SERVER_SOFTWARE"); |
| 1499 | 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> | |
| 1500 | 1504 | if( showAll && blob_size(&g.httpHeader)>0 ){ |
| 1501 | 1505 | @ <hr> |
| 1502 | 1506 | @ <pre> |
| 1503 | 1507 | @ %h(blob_str(&g.httpHeader)) |
| 1504 | 1508 | @ </pre> |
| 1505 | 1509 |
| --- 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 |