Use case sensitive ETag for proxy.

This commit is contained in:
flash 2019-01-16 19:53:45 +01:00
parent e259c91ce8
commit 906abdcd8f

View file

@ -63,9 +63,9 @@ curl_setopt_array($curl, [
$curlBody = curl_exec($curl);
curl_close($curl);
$entityTag = '"' . hash('sha256', $curlBody) . '"';
$entityTag = 'W/"' . hash('sha256', $curlBody) . '"';
if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && strtolower($_SERVER['HTTP_IF_NONE_MATCH']) === $entityTag) {
if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] === $entityTag) {
http_response_code(304);
return;
}