@compas/server
Advanced tools
Comparing version 0.0.149 to 0.0.150
{ | ||
"name": "@compas/server", | ||
"version": "0.0.149", | ||
"version": "0.0.150", | ||
"description": "Koa server and common middleware", | ||
@@ -18,3 +18,3 @@ "main": "./index.js", | ||
"dependencies": { | ||
"@compas/stdlib": "0.0.149", | ||
"@compas/stdlib": "0.0.150", | ||
"co-body": "6.1.0", | ||
@@ -47,3 +47,3 @@ "formidable": "2.0.0-canary.20200504.1", | ||
}, | ||
"gitHead": "dd7fa620c6d3cb6219764bcfc5cc91f711383dfc" | ||
"gitHead": "6bbe148c5e4f643ed7db0bc22fc439091f0fc34a" | ||
} |
@@ -20,2 +20,16 @@ import { isNil } from "@compas/stdlib"; | ||
if (ctx.headers["if-modified-since"]?.length > 0) { | ||
const dateValue = new Date(ctx.headers["if-modified-since"]); | ||
const currentDate = new Date(file.updatedAt ?? file.lastModified); | ||
// Weak validation ignores the milli-seconds part, hence 'weak'. | ||
currentDate.setMilliseconds(0); | ||
if (dateValue.getTime() === currentDate.getTime()) { | ||
// File is not modified | ||
ctx.status = 304; | ||
return; | ||
} | ||
} | ||
if (ctx.headers.range) { | ||
@@ -22,0 +36,0 @@ try { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60341
1944
+ Added@compas/stdlib@0.0.150(transitive)
- Removed@compas/stdlib@0.0.149(transitive)
Updated@compas/stdlib@0.0.150