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

storage: run validation on raw response stream #745

Conversation

stephenplusplus
Copy link
Contributor

Fixes #654

Previously

If a file was uploaded with gzip content encoding, we were computing the hash of the decoded file.

Now

We deliver the decoded file to the user, but compute the hash based on the raw, encoded file contents.

@beshkenadze - it would be awesome if you could try this out to see if the issue you were having is resolved.

@stephenplusplus stephenplusplus added the api: storage Issues related to the Cloud Storage API. label Jul 25, 2015
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 25, 2015
@beshkenadze
Copy link

If not authorized request (403 error), then there is a exception. ;)

/Users/akira/Projects/My/ReviewHub/src/node_modules/gcloud/lib/storage/file.js:552
        res.headers['x-goog-hash'].split(',').forEach(function(hash) {
                                  ^
TypeError: Cannot read property 'split' of undefined
    at DestroyableTransform.<anonymous> (/Users/akira/Projects/My/ReviewHub/src/node_modules/gcloud/lib/storage/file.js:552:35)
    at DestroyableTransform.emit (events.js:107:17)
    at DestroyableTransform.<anonymous> (/Users/akira/Projects/My/ReviewHub/src/node_modules/gcloud/node_modules/stream-forward/index.js:31:26)
    at DestroyableTransform.<anonymous> (/Users/akira/Projects/My/ReviewHub/src/node_modules/gcloud/node_modules/stream-forward/node_modules/on-everything/index.js:12:17)
    at DestroyableTransform.obj.(anonymous function) [as emit] (/Users/akira/Projects/My/ReviewHub/src/node_modules/gcloud/node_modules/stream-forward/node_modules/stubs/index.js:28:10)
    at StreamCache.<anonymous> (/Users/akira/Projects/My/ReviewHub/src/node_modules/gcloud/node_modules/stream-forward/index.js:31:26)
    at StreamCache.<anonymous> (/Users/akira/Projects/My/ReviewHub/src/node_modules/gcloud/node_modules/stream-forward/node_modules/on-everything/index.js:12:17)
    at StreamCache.obj.(anonymous function) [as emit] (/Users/akira/Projects/My/ReviewHub/src/node_modules/gcloud/node_modules/stream-forward/node_modules/stubs/index.js:28:10)
    at Request.<anonymous> (/Users/akira/Projects/My/ReviewHub/src/node_modules/gcloud/node_modules/stream-forward/index.js:31:26)
    at Request.<anonymous> (/Users/akira/Projects/My/ReviewHub/src/node_modules/gcloud/node_modules/stream-forward/node_modules/on-everything/index.js:12:17)

@beshkenadze
Copy link

Otherwise, everything works! Excellent!

@stephenplusplus
Copy link
Contributor Author

Thanks for testing, and great catch! I'm going to merge this and send a separate PR for the issue you found, as it spawned quite a few changes. (Hope you don't mind if I ping you again once that PR is in :))

stephenplusplus added a commit that referenced this pull request Jul 26, 2015
…-without-gzip

storage: run validation on raw response stream
@stephenplusplus stephenplusplus merged commit 5a0e2a0 into googleapis:master Jul 26, 2015
@beshkenadze
Copy link

@stephenplusplus NP.

sofisl pushed a commit that referenced this pull request Nov 10, 2022
PiperOrigin-RevId: 408439482
Source-Link: googleapis/googleapis@b9f6184
Source-Link: googleapis/googleapis-gen@eb888bc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this pull request Nov 11, 2022
sofisl pushed a commit that referenced this pull request Jan 10, 2023
🤖 I have created a release *beep* *boop*
---


## [4.2.0](googleapis/nodejs-dlp@v4.1.1...v4.2.0) (2022-09-22)


### Features

* Add Deidentify action ([#742](googleapis/nodejs-dlp#742)) ([27bb912](googleapis/nodejs-dlp@27bb912))


### Bug Fixes

* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-dlp/issues/1553)) ([#741](googleapis/nodejs-dlp#741)) ([655d6af](googleapis/nodejs-dlp@655d6af))
* Preserve default values in x-goog-request-params header ([#746](googleapis/nodejs-dlp#746)) ([7c53b9f](googleapis/nodejs-dlp@7c53b9f))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
sofisl pushed a commit that referenced this pull request Jan 24, 2023
gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this pull request Jan 25, 2023
gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The downloaded data did not match the data from the server
3 participants