Skip to content

Commit 8c2acdf

Browse files
committed
Merge remote-tracking branch 'origin/MC-31987' into honeycombined24
2 parents 1e4dc60 + ce1f702 commit 8c2acdf

File tree

4 files changed

+15
-23
lines changed

4 files changed

+15
-23
lines changed

app/code/Magento/PageCache/etc/varnish4.vcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ sub vcl_recv {
108108
#unset req.http.Cookie;
109109
}
110110

111+
# Authenticated GraphQL requests should not be cached by default
112+
if (req.url ~ "/graphql" && req.http.Authorization ~ "^Bearer") {
113+
return (pass);
114+
}
115+
111116
return (hash);
112117
}
113118

app/code/Magento/PageCache/etc/varnish5.vcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ sub vcl_recv {
109109
#unset req.http.Cookie;
110110
}
111111

112+
# Authenticated GraphQL requests should not be cached by default
113+
if (req.url ~ "/graphql" && req.http.Authorization ~ "^Bearer") {
114+
return (pass);
115+
}
116+
112117
return (hash);
113118
}
114119

app/code/Magento/PageCache/etc/varnish6.vcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ sub vcl_recv {
109109
#unset req.http.Cookie;
110110
}
111111

112+
# Authenticated GraphQL requests should not be cached by default
113+
if (req.url ~ "/graphql" && req.http.Authorization ~ "^Bearer") {
114+
return (pass);
115+
}
116+
112117
return (hash);
113118
}
114119

lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -192,27 +192,4 @@ public function __sleep()
192192
{
193193
return ['content', 'isRedirect', 'statusCode'];
194194
}
195-
196-
/**
197-
* Sending provided headers.
198-
*
199-
* Had to be overridden because the original did not work correctly with multi-headers.
200-
*/
201-
public function sendHeaders()
202-
{
203-
if ($this->headersSent()) {
204-
return $this;
205-
}
206-
207-
$status = $this->renderStatusLine();
208-
header($status);
209-
210-
/** @var \Zend\Http\Header\HeaderInterface $header */
211-
foreach ($this->getHeaders() as $header) {
212-
header($header->toString(), false);
213-
}
214-
215-
$this->headersSent = true;
216-
return $this;
217-
}
218195
}

0 commit comments

Comments
 (0)