@@ -79,6 +79,7 @@ describe('setting of response header `Access-Control-Allow-Origin`', () => {
7979 'http://localhost:3000' ,
8080 'http://localhost:3001' ,
8181 'https://frontend-7md9ymhyw-serlo.vercel.app' ,
82+ 'https://chancencampus.org' ,
8283 ]
8384
8485 describe ( 'when we are in the staging environment, the same value is sent back in `Access-Control-Allow-Origin`' , ( ) => {
@@ -94,7 +95,7 @@ describe('setting of response header `Access-Control-Allow-Origin`', () => {
9495 } )
9596 } )
9697
97- describe ( 'when we are in the production environment, the current domain is sent back in `Access-Control-Allow-Origin`' , ( ) => {
98+ describe ( 'when we are in the production environment, the current domain or chancencampus.org is sent back in `Access-Control-Allow-Origin`' , ( ) => {
9899 test . each ( domains ) ( 'when `Origin` is `%s`' , async ( origin ) => {
99100 const env = currentTestEnvironmentWhen (
100101 ( conf ) => conf . ENVIRONMENT === 'production' ,
@@ -103,9 +104,15 @@ describe('setting of response header `Access-Control-Allow-Origin`', () => {
103104
104105 const response = await fetchApi ( { headers : { Origin : origin } } , env )
105106
106- expect ( response . headers . get ( 'Access-Control-Allow-Origin' ) ) . toBe (
107- `https://${ env . getDomain ( ) } ` ,
108- )
107+ if ( origin == 'https://chancencampus.org' ) {
108+ expect ( response . headers . get ( 'Access-Control-Allow-Origin' ) ) . toBe (
109+ 'https://chancencampus.org' ,
110+ )
111+ } else {
112+ expect ( response . headers . get ( 'Access-Control-Allow-Origin' ) ) . toBe (
113+ `https://${ env . getDomain ( ) } ` ,
114+ )
115+ }
109116 } )
110117 } )
111118 } )
0 commit comments