Skip to content

http-server-js: handle raw bytes responses with unknown content-types and Http.File response bodies#10799

Merged
timotheeguerin merged 4 commits into
microsoft:mainfrom
witemple-msft:hsjs-bytes-body-payload
May 27, 2026
Merged

http-server-js: handle raw bytes responses with unknown content-types and Http.File response bodies#10799
timotheeguerin merged 4 commits into
microsoft:mainfrom
witemple-msft:hsjs-bytes-body-payload

Conversation

@witemple-msft
Copy link
Copy Markdown
Member

This pull request corrects the handling of bytes responses when they should be treated as raw bytes while preserving JSON-encoding of bytes payloads. It also implements support for Http.File responses with arbitrary content-types and implements setting the filename using the content-disposition header (we always use the "attachment" disposition).

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 26, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-server-js@10799

commit: cd3e012

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

All changed packages have been documented.

  • @typespec/http-server-js
Show changes

@typespec/http-server-js - fix ✏️

Fixed an issue with handling of bytes response bodies with content-types other than "application/json" that would cause http-server-js to emit an invalid attempt to call Uint8Array.toJsonObject.

@typespec/http-server-js - feature ✏️

Added support for Http.File response bodies. File bodies are treated as raw bytes, and the filename is represented in the Content-Disposition header.

@azure-sdk-automation
Copy link
Copy Markdown

azure-sdk-automation Bot commented May 26, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@timotheeguerin timotheeguerin added this pull request to the merge queue May 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks May 27, 2026
@timotheeguerin timotheeguerin added this pull request to the merge queue May 27, 2026
Merged via the queue into microsoft:main with commit e145b7f May 27, 2026
33 checks passed
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.

2 participants