@opra/http 1.27.4 → 1.28.1

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.
@@ -15,9 +15,12 @@ import vary from 'vary';
15
15
  const charsetRegExp = /;\s*charset\s*=/;
16
16
  export class HttpOutgoingHost {
17
17
  attachment(filename) {
18
- if (filename)
18
+ if (filename) {
19
19
  this.contentType(path.extname(filename));
20
- this.setHeader('Content-Disposition', contentDisposition(filename));
20
+ this.setHeader('Content-Disposition', contentDisposition.create(path.basename(filename), {
21
+ type: 'attachment',
22
+ }));
23
+ }
21
24
  return this;
22
25
  }
23
26
  contentType(type) {
@@ -9,6 +9,7 @@ export interface HttpOutgoing extends StrictOmit<NodeOutgoingMessage, 'req' | 'a
9
9
  req: HttpIncoming;
10
10
  readonly finished?: boolean;
11
11
  appendHeader(name: string, value: string | readonly string[]): this;
12
+ getHeader(name: string): number | string | string[] | undefined;
12
13
  setHeader(name: string, value: number | string | readonly string[]): this;
13
14
  /**
14
15
  * Set _Content-Disposition_ header to _attachment_ with optional `filename`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/http",
3
- "version": "1.27.4",
3
+ "version": "1.28.1",
4
4
  "description": "Opra Http Server Adapter",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -13,12 +13,12 @@
13
13
  "base64-stream": "^1.0.0",
14
14
  "busboy": "^1.6.0",
15
15
  "bytes": "^3.1.2",
16
- "content-disposition": "^1.1.0",
17
- "content-type": "^1.0.5",
16
+ "content-disposition": "^2.0.0",
17
+ "content-type": "^2.0.0",
18
18
  "cookie": "^1.1.1",
19
19
  "cookie-signature": "^1.2.2",
20
20
  "encodeurl": "^2.0.0",
21
- "expect": "^30.3.0",
21
+ "expect": "^30.4.1",
22
22
  "fast-tokenizer": "^1.9.0",
23
23
  "fresh": "^0.5.2",
24
24
  "iconv-lite": "^0.7.2",
@@ -33,13 +33,13 @@
33
33
  "toml": "^4.1.1",
34
34
  "tslib": "^2.8.1",
35
35
  "uid": "^2.0.2",
36
- "valgen": "^6.0.3",
36
+ "valgen": "^6.1.0",
37
37
  "vary": "^1.1.2",
38
- "yaml": "^2.8.3"
38
+ "yaml": "^2.9.0"
39
39
  },
40
40
  "peerDependencies": {
41
- "@opra/common": "^1.27.4",
42
- "@opra/core": "^1.27.4"
41
+ "@opra/common": "^1.28.1",
42
+ "@opra/core": "^1.28.1"
43
43
  },
44
44
  "optionalDependencies": {
45
45
  "express": "^4.0.0 || ^5.0.0",