Skip to content

Add minimal SSE response support to azure-core - #50185

Draft
Xiaofei Cao (XiaofeiCao) wants to merge 4 commits into
Azure:mainfrom
XiaofeiCao:sse-restproxy-minimal-patch
Draft

Add minimal SSE response support to azure-core#50185
Xiaofei Cao (XiaofeiCao) wants to merge 4 commits into
Azure:mainfrom
XiaofeiCao:sse-restproxy-minimal-patch

Conversation

@XiaofeiCao

Copy link
Copy Markdown
Contributor

Description

Adds minimal Server-Sent Events support to azure-core RestProxy responses.

  • Preserves text/event-stream response bodies as non-replayable BinaryData instead of buffering an unbounded stream.
  • Detects streaming intent from the request Accept header or response Content-Type header.
  • Couples async and sync Response<BinaryData> body termination to the underlying HttpResponse, closing it on completion, error, or cancellation.
  • Avoids buffering or logging SSE response bodies in HttpLoggingPolicy.
  • Adds focused coverage for media-type detection, logging behavior, replayability, and response ownership.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes. N/A: internal azure-core RestProxy behavior; no package-level public API was added.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up your commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: daa3657a-91d5-48fa-b7ae-6983091cab6a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: daa3657a-91d5-48fa-b7ae-6983091cab6a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c6a36a59-cfcf-4a11-b7d3-967de8071bd3
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c6a36a59-cfcf-4a11-b7d3-967de8071bd3
@github-actions github-actions Bot added the Azure.Core azure-core label Aug 19, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
34 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

Labels

Azure.Core azure-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant