@forge/bundler 4.6.8-next.2 → 4.6.8-next.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/CHANGELOG.md +12 -0
- package/out/stubs/http-impl.d.ts.map +1 -1
- package/out/stubs/http-impl.js +42 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/bundler
|
|
2
2
|
|
|
3
|
+
## 4.6.8-next.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dc1c587: Fix response headers in HTTP polyfill
|
|
8
|
+
|
|
9
|
+
## 4.6.8-next.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 490911c: Pass response headers from HTTP polyfill
|
|
14
|
+
|
|
3
15
|
## 4.6.8-next.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-impl.d.ts","sourceRoot":"","sources":["../../src/stubs/http-impl.ts"],"names":[],"mappings":";;;AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"http-impl.d.ts","sourceRoot":"","sources":["../../src/stubs/http-impl.ts"],"names":[],"mappings":";;;AAMA,OAAO,EAAuB,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAY,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAe,YAAY,EAAS,MAAM,YAAY,CAAC;AAwE9D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;CACH;AAMD,eAAO,MAAM,gBAAgB,YAAa,cAAc,GAAG,MAAM,GAAG,GAAG,8BAChC,CAAC;AAExC,qBAAa,OAAQ,SAAQ,QAAQ;IACnC,OAAO,CAAC,OAAO,CAAW;IAC1B,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI;IAatF,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAM/C,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO;IAQhE,OAAO,CAAC,KAAK;IAsBN,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI;IAe3F,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM;IAUjD,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,GAAG,GAAG,MAAM;IAiBvE,MAAM,CAAC,uBAAuB,CAC5B,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,GAAG,EACtC,gBAAgB,EAAE,gBAAgB,GACjC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,YAAY,CAAA;KAAE;IAuBtC,KAAK;CAGN;AAID,qBAAa,KAAK;gBACJ,OAAO,EAAE,YAAY;CAOlC"}
|
package/out/stubs/http-impl.js
CHANGED
|
@@ -3,12 +3,54 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Agent = exports.Request = exports.isRequestOptions = void 0;
|
|
4
4
|
const readable_stream_1 = require("readable-stream");
|
|
5
5
|
const api_1 = require("@forge/api");
|
|
6
|
+
const HEADERS_DISCARD_DUPLICATES = new Set([
|
|
7
|
+
'age',
|
|
8
|
+
'authorization',
|
|
9
|
+
'content-length',
|
|
10
|
+
'content-type',
|
|
11
|
+
'etag',
|
|
12
|
+
'expires',
|
|
13
|
+
'from',
|
|
14
|
+
'host',
|
|
15
|
+
'if-modified-since',
|
|
16
|
+
'if-unmodified-since',
|
|
17
|
+
'last-modified',
|
|
18
|
+
'location',
|
|
19
|
+
'max-forwards',
|
|
20
|
+
'proxy-authorization',
|
|
21
|
+
'referer',
|
|
22
|
+
'retry-after',
|
|
23
|
+
'server',
|
|
24
|
+
'user-agent'
|
|
25
|
+
]);
|
|
6
26
|
class Response extends readable_stream_1.Readable {
|
|
7
27
|
constructor(content, response) {
|
|
8
28
|
super();
|
|
9
29
|
this.statusCode = response.status;
|
|
10
30
|
this.statusMessage = response.statusText;
|
|
11
31
|
this.headers = {};
|
|
32
|
+
this.headersDistinct = {};
|
|
33
|
+
const rawHeaders = response.headers.raw();
|
|
34
|
+
for (const [name, values] of Object.entries(rawHeaders)) {
|
|
35
|
+
if (name === 'content-encoding') {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
let value;
|
|
39
|
+
if (HEADERS_DISCARD_DUPLICATES.has(name)) {
|
|
40
|
+
value = values[0];
|
|
41
|
+
}
|
|
42
|
+
else if (name === 'set-cookie') {
|
|
43
|
+
value = values;
|
|
44
|
+
}
|
|
45
|
+
else if (name === 'cookie') {
|
|
46
|
+
value = values.join('; ');
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
value = values.join(', ');
|
|
50
|
+
}
|
|
51
|
+
this.headers[name] = value;
|
|
52
|
+
this.headersDistinct[name] = values;
|
|
53
|
+
}
|
|
12
54
|
this._read = () => { };
|
|
13
55
|
this.push(Buffer.from(content));
|
|
14
56
|
this.push(null);
|