-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
fix(GCS): set the response headers accordingly #9858
base: develop
Are you sure you want to change the base?
Conversation
use the appropriate properties for setting the response headers in options object when requesting the signed url (based on the GetSignedUrlConfig interface). Reference: https://cloud.google.com/nodejs/docs/reference/storage/latest/storage/getsignedurlconfig related to nocodb#9350
Roni Bytyqi seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
📝 WalkthroughWalkthroughThe pull request introduces modifications to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/nocodb/src/plugins/gcs/Gcs.ts (1)
182-183
: LGTM! Consider adding type safety for response parameters.The change correctly implements the response headers using the official
GetSignedUrlConfig
properties instead of custom headers, which resolves the 400 Bad Request error. This aligns with the Google Cloud Storage documentation.Consider adding type safety for the path parameters to ensure correct header names are used:
- pathParameters?: { [key: string]: string } + pathParameters?: { + ResponseContentDisposition?: string; + ResponseContentType?: string; + }
Change Summary
use the appropriate properties for setting the response headers in options object when requesting the signed url (based on the GetSignedUrlConfig interface).
Reference:
https://cloud.google.com/nodejs/docs/reference/storage/latest/storage/getsignedurlconfig
Change type
Additional information / screenshots (optional)
I setup Google Cloud Storage as my Storage Provider.
While the files would get uploaded correctly in the Google Cloud Storage Bucket,
when retrieving the file I encountered issue ref: #9350. I was getting the following
400 Bad Request
response from Google Storage API:That's when I started to checkout the signedURL generation, and updated the
GetSignedUrlConfig
object being passed as options when calling getSignedUrl from Google Cloud Storage Client, as they are defined in the reference i have provided above.With this addition it respects the Content-Type and Content-Disposition headers, as they get set correctly on the response from Google Cloud Storage, and getting the files from the bucket works without resolving a Bad Request.