Blank CORS_ORIGIN in .env does not default to false - crashes app instead. #1384
Closed
3 tasks done
Labels
bug
Something isn't working
Prerequisites
I have written a descriptive issue title
I have searched existing issues to ensure it has not already been reported
I agree to follow the Code of Conduct that this project adheres to
API/app/plugin version
10.0.12
Node.js version
v18.15.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
Windows 10
Description
Attempting to run the app while leaving the "CORS_ORIGN" parameter blank in .env will result in a crash in src/config/index.js
Unlike Line 186 which grabs the parameter direct from .env, Line 187 makes use of the parseCorsParameter function to parse string booleans into actual booleans.
If the value "CORS_MAX_AGE" from .env is undefined, the short circuit in Line 186 can take effect. However, a null parameter passed into the function on Line 187 will fail when attempting to evaluate the undefined, so will never make use of the subsequent short circuit
Steps to Reproduce
Run the app with "CORS_ORIGIN" left blank in .env
Expected Behaviour
No response
The text was updated successfully, but these errors were encountered: