Fossil SCM

Do not attempt to detect redirect loops. The client side will do that for us.

drh 2019-01-21 18:34 trunk
Commit 810842f18fffe83f9c1e3928dd03382aaac156647e668376fdd380ac707336bb
1 file changed +2 -17
+2 -17
--- src/main.c
+++ src/main.c
@@ -1359,29 +1359,14 @@
13591359
*/
13601360
int fossil_redirect_to_https_if_needed(int iLevel){
13611361
if( fossil_wants_https(iLevel) ){
13621362
const char *zQS = P("QUERY_STRING");
13631363
char *zURL;
1364
- if( P("redir")!=0 ){
1365
- style_header("Insecure Connection");
1366
- @ <h1>Unable To Establish An Encrypted Connection</h1>
1367
- @ <p>This website requires an encrypted connection.
1368
- @ The current connection is not encrypted
1369
- @ across the entire route between your browser and the server.
1370
- @ An attempt was made to redirect to %h(g.zHttpsURL) but
1371
- @ the connection is still insecure even after the redirect.</p>
1372
- @ <p>This is probably some kind of configuration problem. Please
1373
- @ contact your sysadmin.</p>
1374
- @ <p>Sorry it did not work out.</p>
1375
- style_footer();
1376
- cgi_reply();
1377
- return 1;
1378
- }
13791364
if( zQS==0 || zQS[0]==0 ){
1380
- zURL = mprintf("%s%T?redir=1", g.zHttpsURL, P("PATH_INFO"));
1365
+ zURL = mprintf("%s%T", g.zHttpsURL, P("PATH_INFO"));
13811366
}else if( zQS[0]!=0 ){
1382
- zURL = mprintf("%s%T?%s&redir=1", g.zHttpsURL, P("PATH_INFO"), zQS);
1367
+ zURL = mprintf("%s%T?%s", g.zHttpsURL, P("PATH_INFO"), zQS);
13831368
}
13841369
cgi_redirect_with_status(zURL, 301, "Moved Permanently");
13851370
return 1;
13861371
}
13871372
return 0;
13881373
--- src/main.c
+++ src/main.c
@@ -1359,29 +1359,14 @@
1359 */
1360 int fossil_redirect_to_https_if_needed(int iLevel){
1361 if( fossil_wants_https(iLevel) ){
1362 const char *zQS = P("QUERY_STRING");
1363 char *zURL;
1364 if( P("redir")!=0 ){
1365 style_header("Insecure Connection");
1366 @ <h1>Unable To Establish An Encrypted Connection</h1>
1367 @ <p>This website requires an encrypted connection.
1368 @ The current connection is not encrypted
1369 @ across the entire route between your browser and the server.
1370 @ An attempt was made to redirect to %h(g.zHttpsURL) but
1371 @ the connection is still insecure even after the redirect.</p>
1372 @ <p>This is probably some kind of configuration problem. Please
1373 @ contact your sysadmin.</p>
1374 @ <p>Sorry it did not work out.</p>
1375 style_footer();
1376 cgi_reply();
1377 return 1;
1378 }
1379 if( zQS==0 || zQS[0]==0 ){
1380 zURL = mprintf("%s%T?redir=1", g.zHttpsURL, P("PATH_INFO"));
1381 }else if( zQS[0]!=0 ){
1382 zURL = mprintf("%s%T?%s&redir=1", g.zHttpsURL, P("PATH_INFO"), zQS);
1383 }
1384 cgi_redirect_with_status(zURL, 301, "Moved Permanently");
1385 return 1;
1386 }
1387 return 0;
1388
--- src/main.c
+++ src/main.c
@@ -1359,29 +1359,14 @@
1359 */
1360 int fossil_redirect_to_https_if_needed(int iLevel){
1361 if( fossil_wants_https(iLevel) ){
1362 const char *zQS = P("QUERY_STRING");
1363 char *zURL;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1364 if( zQS==0 || zQS[0]==0 ){
1365 zURL = mprintf("%s%T", g.zHttpsURL, P("PATH_INFO"));
1366 }else if( zQS[0]!=0 ){
1367 zURL = mprintf("%s%T?%s", g.zHttpsURL, P("PATH_INFO"), zQS);
1368 }
1369 cgi_redirect_with_status(zURL, 301, "Moved Permanently");
1370 return 1;
1371 }
1372 return 0;
1373

Keyboard Shortcuts

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