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

Google Drive _getFile doesn't check if a file ID exists before using it #1252

Open
stuartlangridge opened this issue Oct 29, 2021 · 1 comment
Labels
bug good first issue A good issue for first-time contributors googledrive

Comments

@stuartlangridge
Copy link

stuartlangridge commented Oct 29, 2021

In _getFile at

return this._getFileId(path).then((id) => {
and
return this._getMeta(id).then((meta) => {
the Google Drive backend retrieves a file ID but doesn't check that that file ID exists before using it in a request, leading to (if the requested file doesn't exist at all in Google Drive and so has no ID) requests being made to https://www.googleapis.com/drive/v2/files/undefined which is definitely wrong.

This isn't a PR because I'm not sure what should happen here; should that function throw an error, or fake a response object with statusCode 404, or something else?

@raucao
Copy link
Member

raucao commented Oct 31, 2021

This isn't a PR because I'm not sure what should happen here; should that function throw an error, or fake a response object with statusCode 404, or something else?

Faking a 404 seems like a reasonable option to me. I guess any potential issues with that approach would become apparent once you implement and test it.

@raucao raucao added the good first issue A good issue for first-time contributors label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue A good issue for first-time contributors googledrive
Development

No branches or pull requests

2 participants