@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/cjs/index.cjs
CHANGED
|
@@ -402,11 +402,12 @@ class LambdaResponseBuffered extends node_stream.Writable {
|
|
|
402
402
|
/**
|
|
403
403
|
* Add a field to the Vary response header.
|
|
404
404
|
* Used by CORS middleware to indicate response varies by Origin.
|
|
405
|
+
* Uses direct _headers access to bypass dd-trace interception.
|
|
405
406
|
*/
|
|
406
407
|
vary(field) {
|
|
407
|
-
const existing = this.
|
|
408
|
+
const existing = this._headers.get("vary");
|
|
408
409
|
if (!existing) {
|
|
409
|
-
this.
|
|
410
|
+
this._headers.set("vary", field);
|
|
410
411
|
}
|
|
411
412
|
else {
|
|
412
413
|
// Append to existing Vary header if field not already present
|
|
@@ -414,7 +415,7 @@ class LambdaResponseBuffered extends node_stream.Writable {
|
|
|
414
415
|
.split(",")
|
|
415
416
|
.map((f) => f.trim().toLowerCase());
|
|
416
417
|
if (!fields.includes(field.toLowerCase())) {
|
|
417
|
-
this.
|
|
418
|
+
this._headers.set("vary", `${existing}, ${field}`);
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
return this;
|
|
@@ -442,7 +443,8 @@ class LambdaResponseBuffered extends node_stream.Writable {
|
|
|
442
443
|
//
|
|
443
444
|
buildResult() {
|
|
444
445
|
const body = Buffer.concat(this._chunks);
|
|
445
|
-
|
|
446
|
+
// Use direct _headers access to bypass dd-trace interception
|
|
447
|
+
const contentType = this._headers.get("content-type") || "";
|
|
446
448
|
// Determine if response should be base64 encoded
|
|
447
449
|
const isBase64Encoded = this.isBinaryContentType(contentType);
|
|
448
450
|
// Build headers object
|
|
@@ -729,11 +731,12 @@ class LambdaResponseStreaming extends node_stream.Writable {
|
|
|
729
731
|
/**
|
|
730
732
|
* Add a field to the Vary response header.
|
|
731
733
|
* Used by CORS middleware to indicate response varies by Origin.
|
|
734
|
+
* Uses direct _headers access to bypass dd-trace interception.
|
|
732
735
|
*/
|
|
733
736
|
vary(field) {
|
|
734
|
-
const existing = this.
|
|
737
|
+
const existing = this._headers.get("vary");
|
|
735
738
|
if (!existing) {
|
|
736
|
-
this.
|
|
739
|
+
this._headers.set("vary", field);
|
|
737
740
|
}
|
|
738
741
|
else {
|
|
739
742
|
// Append to existing Vary header if field not already present
|
|
@@ -741,7 +744,7 @@ class LambdaResponseStreaming extends node_stream.Writable {
|
|
|
741
744
|
.split(",")
|
|
742
745
|
.map((f) => f.trim().toLowerCase());
|
|
743
746
|
if (!fields.includes(field.toLowerCase())) {
|
|
744
|
-
this.
|
|
747
|
+
this._headers.set("vary", `${existing}, ${field}`);
|
|
745
748
|
}
|
|
746
749
|
}
|
|
747
750
|
return this;
|