Move the method check into unknown_method()
[privoxy.git] / cgisimple.c
index 71b1173..075df85 100644 (file)
@@ -1,4 +1,4 @@
-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.55 2007/04/13 13:36:46 fabiankeil Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.57 2007/06/01 16:53:05 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
@@ -36,6 +36,19 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.55 2007/04/13 13:36:46 fabian
  *
  * Revisions   :
  *    $Log: cgisimple.c,v $
+ *    Revision 1.57  2007/06/01 16:53:05  fabiankeil
+ *    Adjust cgi_show_url_info() to show what forward-override{}
+ *    would do with the requested URL (instead of showing how the
+ *    request for the CGI page would be forwarded if it wasn't a
+ *    CGI request).
+ *
+ *    Revision 1.56  2007/05/21 10:50:35  fabiankeil
+ *    - Use strlcpy() instead of strcpy().
+ *    - Stop treating actions files special. Expect a complete file name
+ *      (with or without path) like it's done for the rest of the files.
+ *      Closes FR#588084.
+ *    - Don't rerun sed() in cgi_show_request().
+ *
  *    Revision 1.55  2007/04/13 13:36:46  fabiankeil
  *    Reference action files in CGI URLs by id instead
  *    of using the first part of the file name.
@@ -1472,6 +1485,7 @@ jb_err cgi_show_url_info(struct client_state *csp,
 
          err = map(exports, "matches", 1, "<b>[Invalid URL specified!]</b>" , 1);
          if (!err) err = map(exports, "final", 1, lookup(exports, "default"), 1);
+         if (!err) err = map_block_killer(exports, "valid-url");
 
          free_current_action(action);
          free_http_request(url_to_query);
@@ -1486,7 +1500,7 @@ jb_err cgi_show_url_info(struct client_state *csp,
       }
 
       /*
-       * We have a warning about SSL paths.  Hide it for insecure sites.
+       * We have a warning about SSL paths.  Hide it for unencrypted sites.
        */
       if (!url_to_query->ssl)
       {
@@ -1559,6 +1573,19 @@ jb_err cgi_show_url_info(struct client_state *csp,
       }
       string_append(&matches, "</table>\n");
 
+      /*
+       * XXX: Kludge to make sure the "Forward settings" section
+       * shows what forward-override{} would do with the requested URL.
+       * No one really cares how the CGI request would be forwarded
+       * if it wasn't intercepted as CGI request in the first place.
+       *
+       * From here on the action bitmask will no longer reflect
+       * the real url (http://config.privoxy.org/show-url-info?url=.*),
+       * but luckily it's no longer required later on anyway.
+       */
+      free_current_action(csp->action);
+      url_actions(url_to_query, csp);
+
       /*
        * Fill in forwarding settings.
        *
@@ -1570,7 +1597,7 @@ jb_err cgi_show_url_info(struct client_state *csp,
        *
        * XXX: Parts of this code could be reused for the
        * "forwarding-failed" template which currently doesn't
-       * display the proxy port and an eventuell second forwarder.
+       * display the proxy port and an eventual second forwarder.
        */
       {
          const struct forward_spec * fwd = forward_url(url_to_query, csp);