/// whether the request targets a /squid-internal- resource (e.g., a MIME
/// icon or a cache manager page) served by this Squid instance
- /// \sa ClientHttpRequest::flags.internal
/// TODO: Rename to avoid a false implication that this flag is true for
/// requests for /squid-internal- resources served by other Squid instances.
bool internal = false;
} else if (internalCheck(hp->requestUri())) { // NP: only matches relative-URI
/* internal URL mode */
- /* prepend our name & port */
+ // XXX: By prepending our name and port, we create an absolute URL
+ // that may mismatch the (yet unparsed) Host header in the request.
http->uri = xstrdup(internalLocalUri(nullptr, hp->requestUri()));
- // We just re-wrote the URL. Must replace the Host: header.
- // But have not parsed there yet!! flag for local-only handling.
- http->flags.internal = true;
} else if (port->flags.accelSurrogate) {
/* accelerator mode */
if (internalCheck(request->url.path())) {
if (internalHostnameIs(request->url.host()) && request->url.port() == getMyPort()) {
debugs(33, 2, "internal URL found: " << request->url.getScheme() << "://" << request->url.authority(true));
- http->flags.internal = true;
+ request->flags.internal = true;
} else if (Config.onoff.global_internal_static && internalStaticCheck(request->url.path())) {
debugs(33, 2, "internal URL found: " << request->url.getScheme() << "://" << request->url.authority(true) << " (global_internal_static on)");
request->url.setScheme(AnyP::PROTO_HTTP, "http");
request->url.host(internalHostname());
request->url.port(getMyPort());
- http->flags.internal = true;
+ request->flags.internal = true;
http->setLogUriToRequestUri();
} else
debugs(33, 2, "internal URL found: " << request->url.getScheme() << "://" << request->url.authority(true) << " (not this proxy)");
request->flags.disableCacheUse("cache manager URL");
}
- request->flags.internal = http->flags.internal;
-
if (!isFtp) {
// XXX: for non-HTTP messages instantiate a different Http::Message child type
// for now Squid only supports HTTP requests
http->updateLoggingTags(LOG_TCP_MISS);
processMiss();
return;
- } else if (!http->flags.internal && refreshCheckHTTP(e, r)) {
+ } else if (!r->flags.internal && refreshCheckHTTP(e, r)) {
debugs(88, 5, "clientCacheHit: in refreshCheck() block");
/*
* We hold a stale copy; it needs to be validated
if (!Config.accessList.sendHit)
return false; // hits are not blocked by default
- if (http->flags.internal)
+ if (http->request->flags.internal)
return false; // internal content "hits" cannot be blocked
const auto &rep = http->storeEntry()->mem().freshestReply();