Skip to content

Commit 811fc4c

Browse files
committed
Don't overwrite Host header set by user
1 parent 829aa94 commit 811fc4c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Invalidation/Varnish.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,11 @@ protected function queueRequest($method, $url, array $headers = array())
149149
{
150150
$request = $this->client->createRequest($method, $url, $headers);
151151

152-
// If $url doesn't contain a hostname, prefix it with the default hostname
152+
// If $url doesn't contain a hostname, and Host header hasn't yet been
153+
// set, set the Host header to the default hostname
153154
$parsedUrl = parse_url($url);
154-
if (!isset($parsedUrl['host'])) {
155+
if (!isset($parsedUrl['host']) && '' != $request->getHeader('Host')
156+
) {
155157
$request->setHeader('Host', $this->host);
156158
}
157159

0 commit comments

Comments
 (0)