mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:27:08 +00:00
Set headers only on 304
This commit is contained in:
@@ -23,9 +23,9 @@ function ifNoneMatch (req, res, next) {
|
|||||||
if (cached) {
|
if (cached) {
|
||||||
DEBUG("ETag match. Returning cached response (ETag: %s, If-None-Match: %s) for %s %s",
|
DEBUG("ETag match. Returning cached response (ETag: %s, If-None-Match: %s) for %s %s",
|
||||||
cached.etag, req.get("If-None-Match"), req.method, req.url);
|
cached.etag, req.get("If-None-Match"), req.method, req.url);
|
||||||
setHeaders(res, cached.headers);
|
|
||||||
if (req.method == "GET" || req.method == "HEAD") {
|
if (req.method == "GET" || req.method == "HEAD") {
|
||||||
res.status(304).send();
|
setHeaders(res, cached.headers);
|
||||||
|
res.status(304).end();
|
||||||
// No next()
|
// No next()
|
||||||
} else if (!isIdempotentMethod(req.method)) {
|
} else if (!isIdempotentMethod(req.method)) {
|
||||||
res.status(412).send();
|
res.status(412).send();
|
||||||
|
|||||||
Reference in New Issue
Block a user