@@ -536,7 +536,10 @@ describe("StaticHosting", () => {
536536 const hosting = new StaticHosting ( stack , "TestConstruct" , {
537537 ...defaultProps ,
538538 corsConfig : {
539- allowOrigins : [ "https://example.com" , "https://app.example.com" ] ,
539+ accessControlAllowOrigins : [
540+ "https://example.com" ,
541+ "https://app.example.com" ,
542+ ] ,
540543 } ,
541544 } ) ;
542545
@@ -567,10 +570,10 @@ describe("StaticHosting", () => {
567570 new StaticHosting ( stack , "TestConstruct" , {
568571 ...defaultProps ,
569572 corsConfig : {
570- allowOrigins : [ "https://example.com" ] ,
571- allowCredentials : true ,
572- allowHeaders : [ "Content-Type" , "Authorization" ] ,
573- allowMethods : [ "GET" , "HEAD" , "OPTIONS" , "POST" ] ,
573+ accessControlAllowOrigins : [ "https://example.com" ] ,
574+ accessControlAllowCredentials : true ,
575+ accessControlAllowHeaders : [ "Content-Type" , "Authorization" ] ,
576+ accessControlAllowMethods : [ "GET" , "HEAD" , "OPTIONS" , "POST" ] ,
574577 originOverride : false ,
575578 } ,
576579 } ) ;
@@ -599,7 +602,7 @@ describe("StaticHosting", () => {
599602 const { stack } = createTestStack ( ) ;
600603 new StaticHosting ( stack , "TestConstruct" , {
601604 ...defaultProps ,
602- corsConfig : { allowOrigins : [ "https://example.com" ] } ,
605+ corsConfig : { accessControlAllowOrigins : [ "https://example.com" ] } ,
603606 } ) ;
604607
605608 const template = Template . fromStack ( stack ) ;
@@ -623,11 +626,11 @@ describe("StaticHosting", () => {
623626 expect ( cssBehavior . ResponseHeadersPolicyId ) . toBeDefined ( ) ;
624627 } ) ;
625628
626- it ( "should not apply CORS policy to static files when allowOrigins is empty array" , ( ) => {
629+ it ( "should not apply CORS policy to static files when accessControlAllowOrigins is empty array" , ( ) => {
627630 const { stack } = createTestStack ( ) ;
628631 const hosting = new StaticHosting ( stack , "TestConstruct" , {
629632 ...defaultProps ,
630- corsConfig : { allowOrigins : [ ] } ,
633+ corsConfig : { accessControlAllowOrigins : [ ] } ,
631634 } ) ;
632635
633636 expect ( hosting . corsResponseHeadersPolicy ) . toBeUndefined ( ) ;
@@ -651,7 +654,7 @@ describe("StaticHosting", () => {
651654 const { stack } = createTestStack ( ) ;
652655 const hosting = new StaticHosting ( stack , "TestConstruct" , {
653656 ...defaultProps ,
654- corsConfig : { allowOrigins : [ "https://example.com" ] } ,
657+ corsConfig : { accessControlAllowOrigins : [ "https://example.com" ] } ,
655658 } ) ;
656659
657660 // The policy should be accessible for downstream projects to use
@@ -664,7 +667,7 @@ describe("StaticHosting", () => {
664667 const { stack } = createTestStack ( ) ;
665668 new StaticHosting ( stack , "TestConstruct" , {
666669 ...defaultProps ,
667- corsConfig : { allowOrigins : [ "https://example.com" ] } ,
670+ corsConfig : { accessControlAllowOrigins : [ "https://example.com" ] } ,
668671 remapPaths : [ { from : "/test-path" , to : "/remapped-path" } ] ,
669672 } ) ;
670673
@@ -686,7 +689,7 @@ describe("StaticHosting", () => {
686689 const { stack } = createTestStack ( ) ;
687690 new StaticHosting ( stack , "TestConstruct" , {
688691 ...defaultProps ,
689- corsConfig : { allowOrigins : [ "https://example.com" ] } ,
692+ corsConfig : { accessControlAllowOrigins : [ "https://example.com" ] } ,
690693 backendHost : "backend.example.com" ,
691694 remapBackendPaths : [ { from : "/api/*" , to : "/api/*" } ] ,
692695 } ) ;
@@ -709,7 +712,7 @@ describe("StaticHosting", () => {
709712 const { stack } = createTestStack ( ) ;
710713 new StaticHosting ( stack , "TestConstruct" , {
711714 ...defaultProps ,
712- corsConfig : { allowOrigins : [ "https://example.com" ] } ,
715+ corsConfig : { accessControlAllowOrigins : [ "https://example.com" ] } ,
713716 indexable : true ,
714717 } ) ;
715718
@@ -787,7 +790,7 @@ describe("StaticHosting", () => {
787790 new StaticHosting ( stack , "TestConstruct" , {
788791 ...defaultProps ,
789792 indexable : false ,
790- corsConfig : { allowOrigins : [ "https://example.com" ] } ,
793+ corsConfig : { accessControlAllowOrigins : [ "https://example.com" ] } ,
791794 } ) ;
792795
793796 const template = Template . fromStack ( stack ) ;
0 commit comments