/*
- * $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
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);