Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate the configuration path for Google Cloud Storage at start time #73

Conversation

julienw
Copy link
Contributor

@julienw julienw commented May 13, 2020

This is a simple patch to validate the configuration for GCS.
Indeed if the path is incorrect the GCS lib returns the underlying "file not found" error, which is special-cased in koa to return a http status 404. When locally testing this was a bit painful.
Instead we validate this value when starting the server. I feel this is more correct.

@julienw julienw requested a review from gregtatum May 13, 2020 13:09
// Note that an empty string is a valid value: in that case the lib will try
// to find the authentication information from other means.
try {
fs.accessSync(googleAuthenticationFilePath, fs.constants.R_OK);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use the synchronous version of the function because this is running at start time.

Copy link
Member

@gregtatum gregtatum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@julienw julienw merged commit 7932923 into firefox-devtools:master May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants