8000 SseEmitter supports custom MimeType by YunKuiLu · Pull Request #34976 · spring-projects/spring-framework · GitHub
[go: up one dir, main page]

Skip to content

SseEmitter supports custom MimeType #34976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

YunKuiLu
Copy link
  • Supports using PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE to modify the default MediaType(text/event-stream).

When I use @GetMapping(produces = "text/event-stream;charset=UTF-8"), the Content-Type in the response has not been replaced with "text/event-stream;charset=UTF-8".


Minimal Reproducible Example:
https://github.com/YunKuiLu/issues-spring-web-sse-utf8


This PR keeps the default behavior unchanged but allows developers to change "text/event-stream" to "text/event-stream;charset=UTF-8" if needed.


related:
#33529
#24632

@YunKuiLu YunKuiLu marked this pull request as draft May 31, 2025 13:50
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 31, 2025
- Supports using `PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE` to modify the default `text/event-stream`

Signed-off-by: YunKui Lu <luyunkui95@gmail.com>
@YunKuiLu YunKuiLu marked this pull request as ready for review May 31, 2025 13:56
@bclozel
Copy link
Member
bclozel commented May 31, 2025

Thanks for the proposal but UTF-8 is already the default and only allowed encoding for this MIME type.
The official specification does not mention any charset parameter.

I'm declining this issue as a result since it seems everything works as designed already.

@bclozel bclozel closed this May 31, 2025
@bclozel bclozel added status: declined A suggestion or change that we don't feel we should currently apply in: web Issues in web modules (web, webmvc, webflux, websocket) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: declined A suggestion or change that we don't feel we should currently apply
4892
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0