File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -521,9 +521,7 @@ protected function sendHeaders() : void
521521 $ this ->setDate ();
522522 }
523523 $ this ->negotiateContentType ();
524- if ($ this ->isAutoEtag () && !$ this ->hasDownload ()) {
525- $ this ->negotiateEtag ();
526- }
524+ $ this ->negotiateEtag ();
527525 $ this ->negotiateCsp ();
528526 \header ($ this ->getStartLine ());
529527 $ replace = $ this ->isReplacingHeaders ();
@@ -619,6 +617,11 @@ protected function negotiateContentType() : void
619617 }
620618
621619 /**
620+ * Negotiate the ETag header.
621+ *
622+ * It does nothing if {@see Framework\HTTP\Response::isAutoEtag()} is false
623+ * or {@see Framework\HTTP\ResponseDownload::hasDownload()} is true.
624+ *
622625 * Set the ETag header, based on the Response body, and start the
623626 * negotiation.
624627 *
@@ -634,6 +637,9 @@ protected function negotiateContentType() : void
634637 */
635638 protected function negotiateEtag () : void
636639 {
640+ if (!$ this ->isAutoEtag () || $ this ->hasDownload ()) {
641+ return ;
642+ }
637643 // Content-Length is required by Firefox,
638644 // otherwise it does not send the If-None-Match header
639645 $ this ->setContentLength ();
You can’t perform that action at this time.
0 commit comments