From: hno <> Date: Sat, 4 Sep 2004 03:20:12 +0000 (+0000) Subject: Bug #947: deny_info redirection with requested URL escaped wrongly X-Git-Tag: SQUID_3_0_PRE4~1065 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c44950c478a4dce28c9487113edfdc54a0ab5723;p=thirdparty%2Fsquid.git Bug #947: deny_info redirection with requested URL escaped wrongly --- diff --git a/src/errorpage.cc b/src/errorpage.cc index 6e4d298d98..cead56eac0 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -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);