@jaypie/express 1.2.4-rc11 → 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 +8 -6
- 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 +8 -6
- 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;
|
|
@@ -728,11 +729,12 @@ class LambdaResponseStreaming extends Writable {
|
|
|
728
729
|
/**
|
|
729
730
|
* Add a field to the Vary response header.
|
|
730
731
|
* Used by CORS middleware to indicate response varies by Origin.
|
|
732
|
+
* Uses direct _headers access to bypass dd-trace interception.
|
|
731
733
|
*/
|
|
732
734
|
vary(field) {
|
|
733
|
-
const existing = this.
|
|
735
|
+
const existing = this._headers.get("vary");
|
|
734
736
|
if (!existing) {
|
|
735
|
-
this.
|
|
737
|
+
this._headers.set("vary", field);
|
|
736
738
|
}
|
|
737
739
|
else {
|
|
738
740
|
// Append to existing Vary header if field not already present
|
|
@@ -740,7 +742,7 @@ class LambdaResponseStreaming extends Writable {
|
|
|
740
742
|
.split(",")
|
|
741
743
|
.map((f) => f.trim().toLowerCase());
|
|
742
744
|
if (!fields.includes(field.toLowerCase())) {
|
|
743
|
-
this.
|
|
745
|
+
this._headers.set("vary", `${existing}, ${field}`);
|
|
744
746
|
}
|
|
745
747
|
}
|
|
746
748
|
return this;
|