File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,28 @@ describe('DDWAF', () => {
185185 assert . strictEqual ( waf . disposed , false )
186186 } )
187187
188+ it ( 'should keep functional handle after updating an invalid configuration' , ( ) => {
189+ const waf = new DDWAF ( rules , 'recommended' )
190+ waf . createOrUpdateConfig ( { } , 'config/update' )
191+
192+ assert ( ! waf . disposed )
193+
194+ const context = waf . createContext ( )
195+ const payload = {
196+ persistent : {
197+ 'server.request.headers.no_cookies' : 'value_ATTack'
198+ }
199+ }
200+
201+ const result = context . run ( payload , TIMEOUT )
202+
203+ assert . strictEqual ( result . timeout , false )
204+ assert . strictEqual ( result . status , 'match' )
205+ assert ( result . events )
206+ assert . deepStrictEqual ( result . actions , { } )
207+ assert ( ! context . disposed )
208+ } )
209+
188210 it ( 'should return true when updating configuration' , ( ) => {
189211 const waf = new DDWAF ( rules , 'recommended' )
190212 const newConfig = {
You can’t perform that action at this time.
0 commit comments