It looks like attachment's eTags are appended with "W/" if behind Cloudflare, to mark them as weak eTags.
This causes the eTag check to fail:
Something like the following would work:
This causes the eTag check to fail:
Code:
$eTag = $this->_request->getServer('HTTP_IF_NONE_MATCH');
if ($eTag && $eTag == '"' . $attachment['attach_date'] . '"')
Something like the following would work:
Code:
$eTag = $this->_request->getServer('HTTP_IF_NONE_MATCH');
if ($eTag && ($eTag == '"' . $attachment['attach_date'] . '"' || $eTag == 'W/"' . $attachment['attach_date'] . '"'))