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

Add file download to node example #530

Merged
merged 6 commits into from
Jul 13, 2021
Merged

Add file download to node example #530

merged 6 commits into from
Jul 13, 2021

Conversation

aeaton-overleaf
Copy link
Contributor

@aeaton-overleaf aeaton-overleaf commented Jul 12, 2021

  • Use docker-compose.yaml to start the fake-gcs service (copied from the dotnet example, with the addition of a build path and a volumes mount to load the example data).
  • Add an example of downloading a file from a bucket.

The download example is currently failing when used with @google-cloud/storage > v5.8.1 unless validation: false is set, which isn't ideal - it seems that fake-gcs needs to be setting a x-goog-hash header on the response.

I've added a line of code that sets X-Goog-Hash on the download response, but I'm not sure when either of obj.Crc32c or obj.Md5Hash are guaranteed to be set on the object, so someone with more knowledge of the server will need to finish this off.

Closes #529.

fakestorage/object.go Outdated Show resolved Hide resolved
@fsouza fsouza marked this pull request as ready for review July 13, 2021 12:39
examples/node/index.js Outdated Show resolved Hide resolved
Copy link
Owner

@fsouza fsouza left a comment

Choose a reason for hiding this comment

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

Thanks for contributing! I'll push a release once this is merged.

@fsouza
Copy link
Owner

fsouza commented Jul 13, 2021

I'll fix the dotnet issue on master.

Temporary workaround for #532 so we can get this PR in.
@fsouza fsouza enabled auto-merge (squash) July 13, 2021 13:49
@fsouza fsouza merged commit cd0b800 into fsouza:main Jul 13, 2021
@aeaton-overleaf aeaton-overleaf deleted the node-file-download branch July 13, 2021 13:55
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.

Can't download files with v5.8.2+ of the Node.js client
2 participants