Add a comment
This commit is contained in:
parent
90fdade566
commit
719fec0828
@ -63,6 +63,9 @@ impl<'r> Responder<'r> for Ructe {
|
|||||||
let etag = format!("{:x}", hasher.finish());
|
let etag = format!("{:x}", hasher.finish());
|
||||||
if r.headers()
|
if r.headers()
|
||||||
.get("If-None-Match")
|
.get("If-None-Match")
|
||||||
|
// This check matches both weak and strong ETags
|
||||||
|
// NGINX (and maybe other software) sometimes sends ETags with a
|
||||||
|
// "W/" prefix, that we ignore here
|
||||||
.any(|s| s[1..s.len() - 1] == etag || s[3..s.len() - 1] == etag)
|
.any(|s| s[1..s.len() - 1] == etag || s[3..s.len() - 1] == etag)
|
||||||
{
|
{
|
||||||
Response::build()
|
Response::build()
|
||||||
|
Loading…
Reference in New Issue
Block a user