Skip to content

Instantly share code, notes, and snippets.

@BirgitPohl
Created January 10, 2020 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BirgitPohl/040c80a341ed9d9a9fda7a4a99acb531 to your computer and use it in GitHub Desktop.
Save BirgitPohl/040c80a341ed9d9a9fda7a4a99acb531 to your computer and use it in GitHub Desktop.
Problem with implicit data type conversion in Javascript
# Google App Engine configation
env_variables:
FEATURE_CORS_ENABLED: false
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();
});
}
@BirgitPohl
Copy link
Author

The existence of a string is true:

Screenshot 2020-01-10 at 11 05 55

Google App Engine configuration: Transforming YAML to JSON:

Screenshot from 2020-01-10 11-45-10

Google App Engine configuration after deployment:

Screenshot from 2020-01-10 11-15-36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment