- Specify the API at the beginning of the title (for example, "BigQuery: ...")
General, Core, and Other are also allowed as types
✅
- OS type and version
I use the Storage lib inside a Cloud Function (Python Beta runntime)
- Python version and virtual environment information
python --version
3.7
- google-cloud-python version
pip show google-cloud, pip show google-<service> or pip freeze
1.12.0
- Stacktrace if available
❌
- Steps to reproduce
❌
- Code example
👇
Hey guys 👋
currently I experiment a little bit with the Cloud Storage library inside a Cloud Function.
For testing I want to make an already uploaded file available via Blob#generate_signed_url.
The thing is - it works. I have no issues.
But Yesterday I spend at least 6 hours for testing it because the method in the generated_signed_url needs to be in uppercase.
Meaning the following does not work:
blob.generate_signed_url(timedelta(minutes=5), "get")
but this works:
blob.generate_signed_url(timedelta(minutes=5), "GET")
After a quick look into your code I found out that you "just put" the string into the generated URL. Without validating if that is a valid HTTP-Method!
https://github.com/GoogleCloudPlatform/google-cloud-python/blob/81bc5ef11d1918580f41e9f8ee2c9be2529b1169/storage/google/cloud/storage/_signing.py#L189
I would recommend (or request with this issue 🙃 ) to either:
- Check if the given string is a valid HTTP-Method (POST, GET, PUT etc.) and make the string to uppercase!
- Or better (but leads to breaking changes (maybe 😃)) make an ENUM of it and only allow to put an enum-value into the method.
General, Core, and Other are also allowed as types
✅
I use the Storage lib inside a
Cloud Function(Python Beta runntime)python --version3.7
pip show google-cloud,pip show google-<service>orpip freeze1.12.0
❌
❌
👇
Hey guys 👋
currently I experiment a little bit with the Cloud Storage library inside a Cloud Function.
For testing I want to make an already uploaded file available via
Blob#generate_signed_url.The thing is - it works. I have no issues.
But Yesterday I spend at least 6 hours for testing it because the
methodin thegenerated_signed_urlneeds to be in uppercase.Meaning the following does not work:
but this works:
After a quick look into your code I found out that you "just put" the string into the generated URL. Without validating if that is a valid HTTP-Method!
https://github.com/GoogleCloudPlatform/google-cloud-python/blob/81bc5ef11d1918580f41e9f8ee2c9be2529b1169/storage/google/cloud/storage/_signing.py#L189
I would recommend (or request with this issue 🙃 ) to either: