From: Roland Rosenfeld Date: Mon, 9 Oct 2006 19:18:28 +0000 (+0000) Subject: Redirect http://p.p/user-manual (without trailing slash) to X-Git-Tag: v_3_0_6~50 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=8272dae9df69d3062c5af5ab825124aadb05825c Redirect p.p/user-manual (without trailing slash) to http://p.p/user-manual/ (with trailing slash), otherwise links will be broken. --- diff --git a/cgisimple.c b/cgisimple.c index 17429798..46bb33ec 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.39 2006/09/08 09:49:23 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.40 2006/09/09 13:05:33 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -36,6 +36,11 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.39 2006/09/08 09:49:23 fabian * * Revisions : * $Log: cgisimple.c,v $ + * Revision 1.40 2006/09/09 13:05:33 fabiankeil + * Modified cgi_send_user_manual to serve binary + * content without destroying it first. Should also be + * faster now. Added ".jpg" check for Content-Type guessing. + * * Revision 1.39 2006/09/08 09:49:23 fabiankeil * Deliver documents in the user-manual directory * with "Content-Type text/css" if their filename @@ -707,6 +712,12 @@ jb_err cgi_send_user_manual(struct client_state *csp, assert(rsp); assert(parameters); + if (!parameters->first) + { + /* requested http://p.p/user-manual (without trailing slash) */ + return cgi_redirect(rsp, CGI_PREFIX "user-manual/"); + } + get_string_param(parameters, "file", &filename); /* Check paramter for hack attempts */ if (filename && strchr(filename, '/'))