The existing terminology carries negative sentiment that can be interpreted in a racial or sense. Updating the name to have no potential for such a connection. Co-authored-by: Justin Rogers <justrog@gmail.com>
		
			
				
	
	
		
			23 lines
		
	
	
		
			657 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			657 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import { homeLocation } from '../../../config/env';
 | |
| import { allowedOrigins } from '../../../config/cors-settings';
 | |
| 
 | |
| export default function constantHeaders() {
 | |
|   return function(req, res, next) {
 | |
|     if (
 | |
|       req.headers &&
 | |
|       req.headers.origin &&
 | |
|       allowedOrigins.includes(req.headers.origin)
 | |
|     ) {
 | |
|       res.header('Access-Control-Allow-Origin', req.headers.origin);
 | |
|     } else {
 | |
|       res.header('Access-Control-Allow-Origin', homeLocation);
 | |
|     }
 | |
|     res.header('Access-Control-Allow-Credentials', true);
 | |
|     res.header(
 | |
|       'Access-Control-Allow-Headers',
 | |
|       'Origin, X-Requested-With, Content-Type, Accept'
 | |
|     );
 | |
|     next();
 | |
|   };
 | |
| }
 |