Skip to content

Commit

Permalink
Add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
elegaanz committed Jun 25, 2020
1 parent 90fdade commit 719fec0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/template_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ impl<'r> Responder<'r> for Ructe {
let etag = format!("{:x}", hasher.finish());
if r.headers()
.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)
{
Response::build()
Expand Down

0 comments on commit 719fec0

Please sign in to comment.