Skip to content

fix(playwright): classify Content-Disposition downloads by type - #129

Merged
slayerjain merged 1 commit into
mainfrom
fix/playwright-content-disposition
Nov 21, 2026
Merged

slayerjain merged 1 commit into
mainfrom
fix/playwright-content-disposition

Conversation

@slayerjain

Copy link
Copy Markdown
Member

Summary

Inflight in @keploy/playwright previously checked /attachment/i.test(content-disposition) across the entire header value, which:

  1. Misclassified inline documents whose filename parameter contained attachment (e.g. inline; filename="attachment-page.html") as downloads, leaving cancelled in-flight calls open until timeout.
  2. Missed unknown valid disposition types (e.g. x-download; filename="a.html") that browsers handle as downloads per RFC 6266 §4.2.

Changes

  • Add isDownloadDisposition in playwright/src/settle.ts checking the RFC 7230 disposition-type token before the first ; (case-insensitive, non-inline).
  • Add unit tests in playwright/test/unit.test.mjs covering disposition types, malformed headers, and fake-context Inflight wiring.
  • Add Playwright end-to-end rows in playwright/test/rows.test.mjs and playwright/test/fixtures/settle.spec.ts for inline-with-attachment-filename and x-download.

Inspect only the Content-Disposition disposition-type token before the
first semicolon per RFC 6266 section 4.2 instead of matching
/attachment/i across the full header value. Inline responses whose
filename contains "attachment" now replace the document cleanly, while
unknown valid disposition types (such as x-download) are classified as
downloads.

Signed-off-by: slayerjain <shubhamkjain@outlook.com>
@slayerjain
slayerjain merged commit 2fe5d2e into main Nov 21, 2026
8 checks passed
@slayerjain
slayerjain deleted the fix/playwright-content-disposition branch November 21, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant