Created
January 10, 2020 12:43
-
-
Save BirgitPohl/040c80a341ed9d9a9fda7a4a99acb531 to your computer and use it in GitHub Desktop.
Problem with implicit data type conversion in Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Google App Engine configation | |
env_variables: | |
FEATURE_CORS_ENABLED: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const configureMiddlewares = (app) => { | |
if (FEATURE_CORS_ENABLED) { | |
// Do some stuff that enables CORS | |
} | |
app.use((err, res, next) => { | |
if (err.message === "CORS") { | |
res.status(401).send( | |
"The CORS policy for this site does not allow access from the specified Origin." | |
); | |
} | |
next(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The existence of a string is true:
Google App Engine configuration: Transforming YAML to JSON:
Google App Engine configuration after deployment: