File tree Expand file tree Collapse file tree 4 files changed +15
-23
lines changed
app/code/Magento/PageCache/etc
lib/internal/Magento/Framework/HTTP/PhpEnvironment Expand file tree Collapse file tree 4 files changed +15
-23
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,11 @@ sub vcl_recv {
108
108
#unset req.http.Cookie;
109
109
}
110
110
111
+ # Authenticated GraphQL requests should not be cached by default
112
+ if (req.url ~ " /graphql" && req.http.Authorization ~ " ^Bearer" ) {
113
+ return (pass );
114
+ }
115
+
111
116
return (hash );
112
117
}
113
118
Original file line number Diff line number Diff line change @@ -109,6 +109,11 @@ sub vcl_recv {
109
109
#unset req.http.Cookie;
110
110
}
111
111
112
+ # Authenticated GraphQL requests should not be cached by default
113
+ if (req.url ~ " /graphql" && req.http.Authorization ~ " ^Bearer" ) {
114
+ return (pass );
115
+ }
116
+
112
117
return (hash );
113
118
}
114
119
Original file line number Diff line number Diff line change @@ -109,6 +109,11 @@ sub vcl_recv {
109
109
#unset req.http.Cookie;
110
110
}
111
111
112
+ # Authenticated GraphQL requests should not be cached by default
113
+ if (req.url ~ " /graphql" && req.http.Authorization ~ " ^Bearer" ) {
114
+ return (pass );
115
+ }
116
+
112
117
return (hash );
113
118
}
114
119
Original file line number Diff line number Diff line change @@ -192,27 +192,4 @@ public function __sleep()
192
192
{
193
193
return ['content ' , 'isRedirect ' , 'statusCode ' ];
194
194
}
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
- }
218
195
}
You can’t perform that action at this time.
0 commit comments