@@ -287,35 +287,6 @@ describe('middlewares', () => {
287287 expect ( headers [ 'Access-Control-Allow-Origin' ] ) . toEqual ( 'https://parseplatform.org/' ) ;
288288 } ) ;
289289
290- it ( 'should support multiple origins if several are defined in allowOrigin as a comma delimited string' , ( ) => {
291- AppCache . put ( fakeReq . body . _ApplicationId , {
292- allowOrigin : 'https://a.com,https://b.com,https://c.com' ,
293- } ) ;
294- const headers = { } ;
295- const res = {
296- header : ( key , value ) => {
297- headers [ key ] = value ;
298- } ,
299- } ;
300- const allowCrossDomain = middlewares . allowCrossDomain ( fakeReq . body . _ApplicationId ) ;
301- // Test with the first domain
302- fakeReq . headers . origin = 'https://a.com' ;
303- allowCrossDomain ( fakeReq , res , ( ) => { } ) ;
304- expect ( headers [ 'Access-Control-Allow-Origin' ] ) . toEqual ( 'https://a.com' ) ;
305- // Test with the second domain
306- fakeReq . headers . origin = 'https://b.com' ;
307- allowCrossDomain ( fakeReq , res , ( ) => { } ) ;
308- expect ( headers [ 'Access-Control-Allow-Origin' ] ) . toEqual ( 'https://b.com' ) ;
309- // Test with the third domain
310- fakeReq . headers . origin = 'https://c.com' ;
311- allowCrossDomain ( fakeReq , res , ( ) => { } ) ;
312- expect ( headers [ 'Access-Control-Allow-Origin' ] ) . toEqual ( 'https://c.com' ) ;
313- // Test with an unauthorized domain
314- fakeReq . headers . origin = 'https://unauthorized.com' ;
315- allowCrossDomain ( fakeReq , res , ( ) => { } ) ;
316- expect ( headers [ 'Access-Control-Allow-Origin' ] ) . toEqual ( 'https://a.com' ) ;
317- } ) ;
318-
319290 it ( 'should support multiple origins if several are defined in allowOrigin as an array' , ( ) => {
320291 AppCache . put ( fakeReq . body . _ApplicationId , {
321292 allowOrigin : [ 'https://a.com' , 'https://b.com' , 'https://c.com' ] ,
0 commit comments