{"rp", LFT_REQUEST_URLPATH_OLD_31},
/* { "rq", LFT_REQUEST_QUERY }, * / / * the query-string, INCLUDING the leading ? */
{"rv", LFT_REQUEST_VERSION},
+ {"rG", LFT_REQUEST_URLGROUP_OLD_2X},
{"<rm", LFT_SERVER_REQ_METHOD},
{"<ru", LFT_SERVER_REQ_URI},
break;
#endif
+ case LFT_REQUEST_URLGROUP_OLD_2X:
+ debugs(46, DBG_PARSE_NOTE(DBG_IMPORTANT), "WARNING: The \"rG\" formatting code is deprecated. Use \"note{urlgroup}\" instead.");
+ type = LFT_NOTE;
+ data.header.header = xstrdup("urlgroup");
+ break;
+
default:
break;
}
* At this point altering the helper buffer in that way is not harmful, but annoying.
* When Bug 1961 is resolved and urlParse has a const API, this needs to die.
*/
- const char * result = reply.other().content();
- const Http::StatusCode status = static_cast<Http::StatusCode>(atoi(result));
+ char * result = reply.modifiableOther().content();
HelperReply newReply;
// BACKWARD COMPATIBILITY 2012-06-15:
newReply.result = HelperReply::Okay;
newReply.notes.append(&reply.notes);
+ // check and parse for obsoleted Squid-2 urlgroup feature
+ if (*result == '!') {
+ static int urlgroupWarning = 0;
+ if (!urlgroupWarning++)
+ debugs(85, DBG_IMPORTANT, "UPGRADE WARNING: URL rewriter using obsolete Squid-2 urlgroup feature needs updating.");
+ if (char *t = strchr(result+1, '!')) {
+ *t = '\0';
+ newReply.notes.add("urlgroup", result+1);
+ result = t + 1;
+ }
+ }
+
+ const Http::StatusCode status = static_cast<Http::StatusCode>(atoi(result));
+
if (status == Http::scMovedPermanently
|| status == Http::scFound
|| status == Http::scSeeOther
// status code is not a redirect code (or does not exist)
// treat as a re-write URL request
// TODO: validate the URL produced here is RFC 2616 compliant URI
- newReply.notes.add("rewrite-url", reply.other().content());
+ if (*result)
+ newReply.notes.add("rewrite-url", result);
}
void *cbdata;