@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;
@@ -302,16 +302,21 @@ class LambdaResponseBuffered extends node_stream.Writable {
302
302
  /**
303
303
  * Express-style alias for getHeader().
304
304
  * Used by middleware like decorateResponse that use res.get().
305
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
305
306
  */
306
307
  get(name) {
307
- return this.getHeader(name);
308
+ return this._headers.get(name.toLowerCase());
308
309
  }
309
310
  /**
310
311
  * Express-style alias for setHeader().
311
312
  * Used by middleware like decorateResponse that use res.set().
313
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
312
314
  */
313
315
  set(name, value) {
314
- return this.setHeader(name, value);
316
+ if (!this._headersSent) {
317
+ this._headers.set(name.toLowerCase(), String(value));
318
+ }
319
+ return this;
315
320
  }
316
321
  status(code) {
317
322
  this.statusCode = code;
@@ -556,16 +561,21 @@ class LambdaResponseStreaming extends node_stream.Writable {
556
561
  /**
557
562
  * Express-style alias for getHeader().
558
563
  * Used by middleware like decorateResponse that use res.get().
564
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
559
565
  */
560
566
  get(name) {
561
- return this.getHeader(name);
567
+ return this._headers.get(name.toLowerCase());
562
568
  }
563
569
  /**
564
570
  * Express-style alias for setHeader().
565
571
  * Used by middleware like decorateResponse that use res.set().
572
+ * Note: Directly accesses _headers to avoid prototype chain issues with bundled code.
566
573
  */
567
574
  set(name, value) {
568
- return this.setHeader(name, value);
575
+ if (!this._headersSent) {
576
+ this._headers.set(name.toLowerCase(), String(value));
577
+ }
578
+ return this;
569
579
  }
570
580
  status(code) {
571
581
  this.statusCode = code;