h3 0.7.3 → 0.7.4
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.
- package/dist/index.cjs +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -85,8 +85,9 @@ function handleCacheHeaders(event, opts) {
|
|
|
85
85
|
opts.cacheControls?.push(`max-age=${+opts.maxAge}`, `s-maxage=${+opts.maxAge}`);
|
|
86
86
|
}
|
|
87
87
|
if (opts.modifiedTime) {
|
|
88
|
+
const modifiedTime = new Date(opts.modifiedTime);
|
|
88
89
|
const ifModifiedSince = event.req.headers["if-modified-since"];
|
|
89
|
-
event.res.setHeader("Last-Modified",
|
|
90
|
+
event.res.setHeader("Last-Modified", modifiedTime.toUTCString());
|
|
90
91
|
if (ifModifiedSince) {
|
|
91
92
|
if (new Date(ifModifiedSince) >= opts.modifiedTime) {
|
|
92
93
|
cacheMatched = true;
|
package/dist/index.d.ts
CHANGED
|
@@ -163,7 +163,7 @@ declare function useRawBody(event: CompatibilityEvent, encoding?: Encoding): Enc
|
|
|
163
163
|
declare function useBody<T = any>(event: CompatibilityEvent): Promise<T>;
|
|
164
164
|
|
|
165
165
|
interface CacheConditions {
|
|
166
|
-
modifiedTime?: Date;
|
|
166
|
+
modifiedTime?: string | Date;
|
|
167
167
|
maxAge?: number;
|
|
168
168
|
etag?: string;
|
|
169
169
|
cacheControls?: string[];
|
package/dist/index.mjs
CHANGED
|
@@ -77,8 +77,9 @@ function handleCacheHeaders(event, opts) {
|
|
|
77
77
|
opts.cacheControls?.push(`max-age=${+opts.maxAge}`, `s-maxage=${+opts.maxAge}`);
|
|
78
78
|
}
|
|
79
79
|
if (opts.modifiedTime) {
|
|
80
|
+
const modifiedTime = new Date(opts.modifiedTime);
|
|
80
81
|
const ifModifiedSince = event.req.headers["if-modified-since"];
|
|
81
|
-
event.res.setHeader("Last-Modified",
|
|
82
|
+
event.res.setHeader("Last-Modified", modifiedTime.toUTCString());
|
|
82
83
|
if (ifModifiedSince) {
|
|
83
84
|
if (new Date(ifModifiedSince) >= opts.modifiedTime) {
|
|
84
85
|
cacheMatched = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "h3",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "Tiny JavaScript Server",
|
|
5
5
|
"repository": "unjs/h3",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"cookie-es": "^0.5.0",
|
|
22
|
-
"destr": "^1.1.
|
|
22
|
+
"destr": "^1.1.1",
|
|
23
23
|
"radix3": "^0.1.1",
|
|
24
|
-
"ufo": "^0.
|
|
24
|
+
"ufo": "^0.8.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"0x": "latest",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"connect": "latest",
|
|
36
36
|
"eslint": "latest",
|
|
37
37
|
"express": "latest",
|
|
38
|
-
"get-port": "^5.
|
|
38
|
+
"get-port": "^5.1.1",
|
|
39
39
|
"jiti": "latest",
|
|
40
40
|
"listhen": "latest",
|
|
41
41
|
"standard-version": "latest",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"unbuild": "latest",
|
|
45
45
|
"vitest": "latest"
|
|
46
46
|
},
|
|
47
|
-
"packageManager": "pnpm@6.32.
|
|
47
|
+
"packageManager": "pnpm@6.32.7",
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "unbuild",
|
|
50
50
|
"dev": "vitest",
|