Skip to content

Commit af8c2ba

Browse files
committed
docs: clarify precedence and signature rules for storage file download options
1 parent caea264 commit af8c2ba

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

handwritten/storage/src/file.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,23 @@ export interface GetSignedUrlConfig
209209
* A convenience option to prompt the browser to save the downloaded file with a specific filename.
210210
* This is a friendly shortcut that automatically formats the `responseDisposition` parameter
211211
* under the hood to `attachment; filename="<filename>"`.
212+
* Note: If both `promptSaveAs` and `responseDisposition` are specified, `promptSaveAs` takes precedence
213+
* and overrides `responseDisposition`.
212214
*/
213215
promptSaveAs?: string;
214216

215217
/**
216-
* Additional query parameters to include in the signature and append to the final signed URL.
218+
* Additional query parameters to append to the final signed URL.
219+
* Note: For V4 signed URLs, only query parameters starting with `x-goog-` are included in the signature
220+
* (and thus protected against tampering). Other custom query parameters are appended to the URL but not signed.
217221
*/
218222
queryParams?: Query;
219223

220224
/**
221225
* Overrides the `Content-Disposition` response header returned by GCS on download.
222226
* For example, setting this to `attachment; filename="new-name.png"` forces the browser
223227
* to download the file with the specified filename.
228+
* Note: This option will be overridden if `promptSaveAs` is also specified.
224229
*/
225230
responseDisposition?: string;
226231

0 commit comments

Comments
 (0)