-
Notifications
You must be signed in to change notification settings - Fork 151
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
feat: add support for custom headers #1121
Conversation
* Refactor client.download_blob_to_file * Chore: clean up code * refactor blob and client unit tests * lint reformat * Rename _prep_and_do_download
* Refactor client.download_blob_to_file * Chore: clean up code * refactor blob and client unit tests * lint reformat * Rename _prep_and_do_download * Refactor blob.upload_from_file * Lint reformat
…oogleapis#1082) * Refactor client.download_blob_to_file * Chore: clean up code * refactor blob and client unit tests * lint reformat * Rename _prep_and_do_download * Refactor blob.upload_from_file * Lint reformat * feature: add 'command' argument to private upload/download interface * lint reformat * reduce duplication and edit docstring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to have integration tests as well but since we don't typically snoop on outbound requests in our integration tests, and since custom headers don't usually have an impact on API behavior that is easily observable at the level our tests run, it may be difficult. Consider creative ways to implement an integration test if any come to mind; otherwise, good to go. Thanks.
The customized headers in client are supported starting from this version (googleapis/python-storage#1121). This feature is needed to set the user-agent during storage client initialization.
Add support for custom headers on a per-client basis
Reference - https://cloud.google.com/storage/docs/troubleshooting#custom-headers
The following sample adds a custom header to the requests made by the client
Fixes internal b/294091512 🦕