@yumerijs/core 2.0.8 → 2.0.9

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/dist/session.js +4 -6
  2. package/package.json +1 -1
package/dist/session.js CHANGED
@@ -292,16 +292,14 @@ class Session {
292
292
  * @param option 选项
293
293
  */
294
294
  setCache(option) {
295
- const headers = [];
296
295
  if (option.etag)
297
- headers.push(`ETag: "${option.etag}"`);
296
+ this.head['ETag'] = `"${option.etag}"`;
298
297
  if (option.modified)
299
- headers.push(`Last-Modified: ${option.modified.toUTCString()}`);
298
+ this.head['Last-Modified'] = option.modified.toUTCString();
300
299
  if (option.maxAge !== undefined)
301
- headers.push(`Cache-Control: max-age=${option.maxAge}`);
300
+ this.head['Cache-Control'] = `max-age=${option.maxAge}`;
302
301
  if (option.expires)
303
- headers.push(`Expires: ${option.expires.toUTCString()}`);
304
- this.head['Cache-Control'] = headers.join('\n');
302
+ this.head['Expires'] = option.expires.toUTCString();
305
303
  }
306
304
  static(path, option) {
307
305
  // 先查看用户是否在询问文件修改情况
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yumerijs/core",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "Core module for yumeri",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",