@jaypie/express 1.2.4-rc4 → 1.2.4-rc5

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.
@@ -33,11 +33,13 @@ export declare class LambdaResponseBuffered extends Writable {
33
33
  /**
34
34
  * Express-style alias for getHeader().
35
35
  * Used by middleware like decorateResponse that use res.get().
36
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
36
37
  */
37
38
  get(name: string): number | string | string[] | undefined;
38
39
  /**
39
40
  * Express-style alias for setHeader().
40
41
  * Used by middleware like decorateResponse that use res.set().
42
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
41
43
  */
42
44
  set(name: string, value: number | string | string[]): this;
43
45
  status(code: number): this;
@@ -34,11 +34,13 @@ export declare class LambdaResponseStreaming extends Writable {
34
34
  /**
35
35
  * Express-style alias for getHeader().
36
36
  * Used by middleware like decorateResponse that use res.get().
37
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
37
38
  */
38
39
  get(name: string): number | string | string[] | undefined;
39
40
  /**
40
41
  * Express-style alias for setHeader().
41
42
  * Used by middleware like decorateResponse that use res.set().
43
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
42
44
  */
43
45
  set(name: string, value: number | string | string[]): this;
44
46
  status(code: number): this;
package/dist/esm/index.js CHANGED
@@ -300,16 +300,21 @@ class LambdaResponseBuffered extends Writable {
300
300
  /**
301
301
  * Express-style alias for getHeader().
302
302
  * Used by middleware like decorateResponse that use res.get().
303
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
303
304
  */
304
305
  get(name) {
305
- return this.getHeader(name);
306
+ return this._headers.get(name.toLowerCase());
306
307
  }
307
308
  /**
308
309
  * Express-style alias for setHeader().
309
310
  * Used by middleware like decorateResponse that use res.set().
311
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
310
312
  */
311
313
  set(name, value) {
312
- return this.setHeader(name, value);
314
+ if (!this._headersSent) {
315
+ this._headers.set(name.toLowerCase(), String(value));
316
+ }
317
+ return this;
313
318
  }
314
319
  status(code) {
315
320
  this.statusCode = code;
@@ -554,16 +559,21 @@ class LambdaResponseStreaming extends Writable {
554
559
  /**
555
560
  * Express-style alias for getHeader().
556
561
  * Used by middleware like decorateResponse that use res.get().
562
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
557
563
  */
558
564
  get(name) {
559
- return this.getHeader(name);
565
+ return this._headers.get(name.toLowerCase());
560
566
  }
561
567
  /**
562
568
  * Express-style alias for setHeader().
563
569
  * Used by middleware like decorateResponse that use res.set().
570
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
564
571
  */
565
572
  set(name, value) {
566
- return this.setHeader(name, value);
573
+ if (!this._headersSent) {
574
+ this._headers.set(name.toLowerCase(), String(value));
575
+ }
576
+ return this;
567
577
  }
568
578
  status(code) {
569
579
  this.statusCode = code;