]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #947: deny_info redirection with requested URL escaped wrongly
authorhno <>
Sat, 4 Sep 2004 03:20:12 +0000 (03:20 +0000)
committerhno <>
Sat, 4 Sep 2004 03:20:12 +0000 (03:20 +0000)
src/errorpage.cc

index 6e4d298d98835de119a862ef7daa8aad001cf0ef..cead56eac00f8f76f3e85e690b7f1a04d73abf04 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.196 2004/08/30 03:28:59 robertc Exp $
+ * $Id: errorpage.cc,v 1.197 2004/09/03 21:20:12 hno Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -831,9 +831,13 @@ errorBuildReply(ErrorState * err)
 
     if (strchr(name, ':')) {
         /* Redirection */
-        char *quoted_url = rfc1738_escape_part(errorConvert('u', err));
         httpReplySetHeaders(rep, version, HTTP_MOVED_TEMPORARILY, NULL, "text/html", 0, 0, squid_curtime);
-        httpHeaderPutStrf(&rep->header, HDR_LOCATION, name, quoted_url);
+
+        if (err->request) {
+            char *quoted_url = rfc1738_escape_part(urlCanonical(err->request));
+            httpHeaderPutStrf(&rep->header, HDR_LOCATION, name, quoted_url);
+        }
+
         httpHeaderPutStrf(&rep->header, HDR_X_SQUID_ERROR, "%d %s\n", err->httpStatus, "Access Denied");
     } else {
         MemBuf content = errorBuildContent(err);