File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8686if CONFIG ['server' ].get ('cors' , False ):
8787 try :
8888 from flask_cors import CORS
89- CORS (APP , CORS_EXPOSE_HEADERS = [ '*' ] )
89+ CORS (APP , expose_headers = '*' )
9090 except ModuleNotFoundError :
9191 print ('Python package flask-cors required for CORS support' )
9292
Original file line number Diff line number Diff line change @@ -280,6 +280,9 @@ def test_apirules_active(config_with_rules, rules_api):
280280 assert response .status_code == 200
281281 response = flask_client .get (flask_prefix )
282282 assert response .status_code in (307 , 308 )
283+ # Ensure that the expose-headers are set regardless of
284+ # whether apirules are active or not
285+ assert response .headers ['Access-Control-Expose-Headers' ] == '*'
283286
284287 # Test links on landing page for correct URLs
285288 response = flask_client .get (flask_prefix , follow_redirects = True )
@@ -342,6 +345,9 @@ def test_apirules_inactive(config, api_):
342345 flask_client .application .url_for ('pygeoapi.conformance' )
343346 response = flask_client .get ('/static/img/pygeoapi.png' )
344347 assert response .status_code == 200
348+ # Ensure that the expose-headers are set regardless of
349+ # whether apirules are active or not
350+ assert response .headers ['Access-Control-Expose-Headers' ] == '*'
345351
346352 # Test trailing slashes
347353 response = flask_client .get ('/' )
You can’t perform that action at this time.
0 commit comments