@server/next 0.48.2 → 0.48.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +4 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2498,7 +2498,7 @@ function parseRange(header, size) {
2498
2498
  }
2499
2499
 
2500
2500
  // src/middle/assets.ts
2501
- var CACHE_CONTROL = "public, max-age=3600";
2501
+ var DEFAULT_CACHE = "public, max-age=3600";
2502
2502
  async function assets(ctx) {
2503
2503
  if (!ctx.options.public) return;
2504
2504
  if (ctx.method !== "get" && ctx.method !== "head") return;
@@ -2511,7 +2511,9 @@ async function assets(ctx) {
2511
2511
  if (info ? !meta2 : !await file2.exists()) return;
2512
2512
  const ext = ctx.url.pathname.split(".").pop()?.toLowerCase();
2513
2513
  const ctype = ext && mimes_default[ext] || meta2?.type || ext;
2514
- const headers2 = { "cache-control": CACHE_CONTROL };
2514
+ const headers2 = {
2515
+ "cache-control": resolveCache(ctx.options.cache) ?? DEFAULT_CACHE
2516
+ };
2515
2517
  let tag;
2516
2518
  if (meta2) {
2517
2519
  const stamp = meta2.modified ? meta2.modified.getTime() : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@server/next",
3
- "version": "0.48.2",
3
+ "version": "0.48.3",
4
4
  "description": "A fully-fledged web server with routing, file uploads, sessions, static files, schema validation, websockets, testing, etc.",
5
5
  "homepage": "https://server-js.com/",
6
6
  "repository": "github:franciscop/server-next",