Diff
Not logged in

Differences From:

File src/cgi.c part of check-in [677aa71bca] - The g.zExtra parameter is now always available as P("name"). This means the /wiki/xyz and /wiki?name=xyz are equivalent URLs. by drh on 2007-10-12 22:56:18. [view]

To:

File src/cgi.c part of check-in [f66089ec43] - Untested, experimental patch for correct redirect to the /index page when only the CGI script name is specified. by drh on 2007-10-23 18:04:19. [view]

@@ -296,11 +296,12 @@
 void cgi_redirect(const char *zURL){
   char *zLocation;
   CGIDEBUG(("redirect to %s\n", zURL));
   if( strncmp(zURL,"http:",5)==0 || strncmp(zURL,"https:",6)==0 || *zURL=='/' ){
-    cgi_panic("invalid redirect URL: %s", zURL);
-  }
-  zLocation = mprintf("Location: %s/%s\r\n", g.zBaseURL, zURL);
+    zLocation = mprintf("Location: %s\r\n", zURL);
+  }else{
+    zLocation = mprintf("Location: %s/%s\r\n", g.zBaseURL, zURL);
+  }
   cgi_append_header(zLocation);
   cgi_reset_content();
   cgi_printf("<html>\n<p>Redirect to %h</p>\n</html>\n", zURL);
   cgi_set_status(302, "Moved Temporarily");