File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -95,8 +95,10 @@ export class SetCookie implements HeaderValue, SetCookieInit {
95
95
break ;
96
96
case 'expires' : {
97
97
if ( typeof value === 'string' ) {
98
- let v = new Date ( value ) ;
99
- if ( isValidDate ( v ) ) this . expires = v ;
98
+ let date = new Date ( value ) ;
99
+ if ( isValidDate ( date ) ) {
100
+ this . expires = date ;
101
+ }
100
102
}
101
103
break ;
102
104
}
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { type CookieInit, Cookie } from './cookie.ts';
7
7
import { canonicalHeaderName } from './header-names.ts' ;
8
8
import { type HeaderValue } from './header-value.ts' ;
9
9
import { type SetCookieInit , SetCookie } from './set-cookie.ts' ;
10
- import { isIterable , isValidDate } from './utils.ts' ;
10
+ import { isIterable } from './utils.ts' ;
11
11
12
12
const CRLF = '\r\n' ;
13
13
const SetCookieKey = 'set-cookie' ;
@@ -595,9 +595,9 @@ export class SuperHeaders extends Headers {
595
595
}
596
596
}
597
597
598
- let header = new ctor ( ) ;
599
- this . #map. set ( key , header ) ;
600
- return header ;
598
+ let obj = new ctor ( ) ;
599
+ this . #map. set ( key , obj ) ; // cache the new object
600
+ return obj ;
601
601
}
602
602
603
603
#setHeaderValue( key : string , ctor : new ( init ?: string ) => HeaderValue , value : any ) : void {
You can’t perform that action at this time.
0 commit comments