File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed
Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ type Updater<T> = T | ((value: T) => T)
125125export class Cookie < T > implements ElysiaCookie {
126126 constructor (
127127 private name : string ,
128- // Modifications here lead to changes in the response headers. Initially empty .
128+ // Modifications here lead to changes in the response headers. Empty at the start of a request .
129129 private jar : Record < string , ElysiaCookie > ,
130130 private readonly initial : Partial < ElysiaCookie > = { }
131131 ) { }
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ describe('Cookie - Unchanged Values', () => {
108108 expect ( response . headers . getAll ( 'set-cookie' ) . length ) . toBeGreaterThan ( 0 )
109109 } )
110110
111- it ( 'cookie handling should be idempotent ' , async ( ) => {
111+ it ( 'should idempotently create headers on cookie modifications ' , async ( ) => {
112112 const app = new Elysia ( ) . post ( '/update' , ( { cookie : { data } } ) => {
113113 // Set to same value as incoming cookie
114114 data . value = { id : 123 , name : 'test' }
@@ -132,7 +132,6 @@ describe('Cookie - Unchanged Values', () => {
132132 } )
133133 )
134134
135- // Should not send Set-Cookie since value didn't change
136135 expect ( secondRes . headers . getAll ( 'set-cookie' ) . length ) . toBe ( 1 )
137136 } )
138137
You can’t perform that action at this time.
0 commit comments