Better caching

Based on @trinity-1686a's patch: https://github.com/Plume-org/Plume/issues/786#issuecomment-647170325
This commit is contained in:
Ana Gelez 2020-06-25 21:49:03 +02:00
parent 28576c1fa3
commit 90fdade566

View File

@ -63,7 +63,7 @@ impl<'r> Responder<'r> for Ructe {
let etag = format!("{:x}", hasher.finish());
if r.headers()
.get("If-None-Match")
.any(|s| s[1..s.len() - 1] == etag)
.any(|s| s[1..s.len() - 1] == etag || s[3..s.len() - 1] == etag)
{
Response::build()
.status(Status::NotModified)