Skip to content

feat: add response header overrides for downloads#136

Open
goanpeca wants to merge 3 commits into
mainfrom
feat/issue-95-response-header-overrides
Open

feat: add response header overrides for downloads#136
goanpeca wants to merge 3 commits into
mainfrom
feat/issue-95-response-header-overrides

Conversation

@goanpeca

@goanpeca goanpeca commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds response-content-disposition, response-content-type, and response-cache-control inputs for presign/download response header overrides.
  • Validates override values for control characters, field length, and field-specific syntax before B2 requests.
  • Threads validated overrides through B2 download options and presigned URL authorization/query params, with presign authorization centralized behind one helper.
  • Documents the new inputs, updates the changelog, and regenerates the bundled dist artifact.

Linked issue

Tests run

  • pnpm test
  • pnpm typecheck
  • pnpm lint
  • pnpm docs:check-action-yml
  • pnpm check:release-provenance
  • pnpm build
  • pnpm spellcheck

Follow-up notes

  • None.

Copilot AI review requested due to automatic review settings July 2, 2026 14:16
@goanpeca goanpeca added this to the v1.2.0 milestone Jul 2, 2026
@goanpeca goanpeca added enhancement New feature or request sdk-parity SDK capability not yet exposed by the action labels Jul 2, 2026
@goanpeca goanpeca self-assigned this Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Build artifact for this PR: build.tar.gz (valid 1 hour)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for overriding download response headers (Content-Disposition, Content-Type, Cache-Control) via new action inputs, wiring them through both direct downloads and presigned URLs (including the download-authorization request and the resulting URL query params).

Changes:

  • Introduces new inputs (content-disposition, response-content-type, cache-control) and parses them into ParsedInputs.
  • Threads these overrides into download (SDK bucket.download options) and presign (download authorization + appended query params on the presigned URL).
  • Updates documentation, action metadata, tests, and the committed dist/ bundle.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/inputs.ts Adds parsed inputs for response header overrides.
src/download-overrides.ts Centralizes mapping from inputs → SDK override options and URL query params.
src/commands/presign.ts Includes overrides in b2_get_download_authorization and appends them to presigned URLs.
src/commands/download.ts Passes overrides through to bucket.download() calls.
action.yml Documents the new inputs on the action surface.
README.md Documents new inputs and updates the presign download example.
tests/inputs.test.ts Adds coverage for parsing the new inputs.
tests/commands/upload-download.test.ts Verifies download calls receive the override options.
tests/commands/delete-copy-presign.test.ts Verifies presign auth request + URL query params include overrides.
tests/_parsed-inputs.ts Updates test helper defaults for the expanded ParsedInputs shape.
dist/index.js Updates bundled output to match the new source behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Build artifact for this PR: build.tar.gz (valid 1 hour)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 13 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 13 changed files in this pull request and generated no new comments.

@goanpeca goanpeca marked this pull request as ready for review July 2, 2026 14:40
Copilot AI review requested due to automatic review settings July 8, 2026 23:27
@goanpeca goanpeca force-pushed the feat/issue-95-response-header-overrides branch from 6f1b839 to 127d408 Compare July 8, 2026 23:27
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Build artifact for this PR: build.tar.gz (valid 1 hour)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 13 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request sdk-parity SDK capability not yet exposed by the action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

presign/download: response-header overrides (filename, content-type, cache-control)

2 participants