@jaypie/express 1.2.4-rc10 → 1.2.4-rc12
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/cjs/adapter/LambdaResponseBuffered.d.ts +1 -0
- package/dist/cjs/adapter/LambdaResponseStreaming.d.ts +1 -0
- package/dist/cjs/index.cjs +10 -7
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/adapter/LambdaResponseBuffered.d.ts +1 -0
- package/dist/esm/adapter/LambdaResponseStreaming.d.ts +1 -0
- package/dist/esm/index.js +10 -7
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -52,6 +52,7 @@ export declare class LambdaResponseBuffered extends Writable {
|
|
|
52
52
|
/**
|
|
53
53
|
* Add a field to the Vary response header.
|
|
54
54
|
* Used by CORS middleware to indicate response varies by Origin.
|
|
55
|
+
* Uses direct _headers access to bypass dd-trace interception.
|
|
55
56
|
*/
|
|
56
57
|
vary(field: string): this;
|
|
57
58
|
_write(chunk: Buffer | string, encoding: BufferEncoding, // eslint-disable-line no-undef
|
|
@@ -53,6 +53,7 @@ export declare class LambdaResponseStreaming extends Writable {
|
|
|
53
53
|
/**
|
|
54
54
|
* Add a field to the Vary response header.
|
|
55
55
|
* Used by CORS middleware to indicate response varies by Origin.
|
|
56
|
+
* Uses direct _headers access to bypass dd-trace interception.
|
|
56
57
|
*/
|
|
57
58
|
vary(field: string): this;
|
|
58
59
|
_write(chunk: Buffer | string, encoding: BufferEncoding, // eslint-disable-line no-undef
|
package/dist/esm/index.js
CHANGED
|
@@ -400,11 +400,12 @@ class LambdaResponseBuffered extends Writable {
|
|
|
400
400
|
/**
|
|
401
401
|
* Add a field to the Vary response header.
|
|
402
402
|
* Used by CORS middleware to indicate response varies by Origin.
|
|
403
|
+
* Uses direct _headers access to bypass dd-trace interception.
|
|
403
404
|
*/
|
|
404
405
|
vary(field) {
|
|
405
|
-
const existing = this.
|
|
406
|
+
const existing = this._headers.get("vary");
|
|
406
407
|
if (!existing) {
|
|
407
|
-
this.
|
|
408
|
+
this._headers.set("vary", field);
|
|
408
409
|
}
|
|
409
410
|
else {
|
|
410
411
|
// Append to existing Vary header if field not already present
|
|
@@ -412,7 +413,7 @@ class LambdaResponseBuffered extends Writable {
|
|
|
412
413
|
.split(",")
|
|
413
414
|
.map((f) => f.trim().toLowerCase());
|
|
414
415
|
if (!fields.includes(field.toLowerCase())) {
|
|
415
|
-
this.
|
|
416
|
+
this._headers.set("vary", `${existing}, ${field}`);
|
|
416
417
|
}
|
|
417
418
|
}
|
|
418
419
|
return this;
|
|
@@ -440,7 +441,8 @@ class LambdaResponseBuffered extends Writable {
|
|
|
440
441
|
//
|
|
441
442
|
buildResult() {
|
|
442
443
|
const body = Buffer.concat(this._chunks);
|
|
443
|
-
|
|
444
|
+
// Use direct _headers access to bypass dd-trace interception
|
|
445
|
+
const contentType = this._headers.get("content-type") || "";
|
|
444
446
|
// Determine if response should be base64 encoded
|
|
445
447
|
const isBase64Encoded = this.isBinaryContentType(contentType);
|
|
446
448
|
// Build headers object
|
|
@@ -727,11 +729,12 @@ class LambdaResponseStreaming extends Writable {
|
|
|
727
729
|
/**
|
|
728
730
|
* Add a field to the Vary response header.
|
|
729
731
|
* Used by CORS middleware to indicate response varies by Origin.
|
|
732
|
+
* Uses direct _headers access to bypass dd-trace interception.
|
|
730
733
|
*/
|
|
731
734
|
vary(field) {
|
|
732
|
-
const existing = this.
|
|
735
|
+
const existing = this._headers.get("vary");
|
|
733
736
|
if (!existing) {
|
|
734
|
-
this.
|
|
737
|
+
this._headers.set("vary", field);
|
|
735
738
|
}
|
|
736
739
|
else {
|
|
737
740
|
// Append to existing Vary header if field not already present
|
|
@@ -739,7 +742,7 @@ class LambdaResponseStreaming extends Writable {
|
|
|
739
742
|
.split(",")
|
|
740
743
|
.map((f) => f.trim().toLowerCase());
|
|
741
744
|
if (!fields.includes(field.toLowerCase())) {
|
|
742
|
-
this.
|
|
745
|
+
this._headers.set("vary", `${existing}, ${field}`);
|
|
743
746
|
}
|
|
744
747
|
}
|
|
745
748
|
return this;
|