@e-mc/request 0.14.1 → 0.14.2

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 (3) hide show
  1. package/README.md +4 -4
  2. package/index.js +4 -1
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- * [View Source](https://www.unpkg.com/@e-mc/types@0.14.1/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.14.2/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { IModule, ModuleConstructor } from "./index";
@@ -253,9 +253,9 @@ instance.get("http://hostname/path/config.yml", options).then(data => {
253
253
 
254
254
  ## References
255
255
 
256
- - https://www.unpkg.com/@e-mc/types@0.14.1/lib/http.d.ts
257
- - https://www.unpkg.com/@e-mc/types@0.14.1/lib/request.d.ts
258
- - https://www.unpkg.com/@e-mc/types@0.14.1/lib/settings.d.ts
256
+ - https://www.unpkg.com/@e-mc/types@0.14.2/lib/http.d.ts
257
+ - https://www.unpkg.com/@e-mc/types@0.14.2/lib/request.d.ts
258
+ - https://www.unpkg.com/@e-mc/types@0.14.2/lib/settings.d.ts
259
259
 
260
260
  * https://www.npmjs.com/package/@types/node
261
261
 
package/index.js CHANGED
@@ -1783,9 +1783,12 @@ class Request extends Module {
1783
1783
  }
1784
1784
  if (headers) {
1785
1785
  const cacheControl = headers['cache-control']?.toLowerCase();
1786
- if (headers.authorization && !cacheControl?.includes('max-age') || cacheControl?.includes('no-cache')) {
1786
+ if (headers.authorization && !cacheControl?.includes('max-age')) {
1787
1787
  options.noCache ??= true;
1788
1788
  }
1789
+ else if (cacheControl?.includes('no-cache')) {
1790
+ options.noCache ??= 0;
1791
+ }
1789
1792
  if (cacheControl?.includes('no-store')) {
1790
1793
  options.noStore ??= true;
1791
1794
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/request",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "description": "Request constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -16,8 +16,8 @@
16
16
  "license": "BSD-3-Clause",
17
17
  "homepage": "https://github.com/anpham6/e-mc#readme",
18
18
  "dependencies": {
19
- "@e-mc/module": "0.14.1",
20
- "@e-mc/types": "0.14.1",
19
+ "@e-mc/module": "0.14.2",
20
+ "@e-mc/types": "0.14.2",
21
21
  "combined-stream": "^1.0.8",
22
22
  "js-yaml": "^4.1.1",
23
23
  "picomatch": "^4.0.4",