Skip to content
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

fix (docs): update Hono examples to use the text/event-stream content type #4687

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hkjorgensen
Copy link

The current documentation explicitly sets the Content-Type header to text/plain, which disables streaming functionality in browsers, defeating the purpose of streaming data. When set to text/plain, browsers wait for the HTTP request to complete before passing data to client-side logic.

This issue can be resolved by changing the HTTP header Content-Type to text/event-stream.

@lgrammel
Copy link
Collaborator

lgrammel commented Feb 5, 2025

Technically we are not sending SSE at the moment, which is why I'm hesitant to change the example (see https://chatgpt.com/share/e/67a33631-bb04-8000-9fa0-cf417cc6c53a for more details).

Which browser / setup caused you issues with the text/plain configuration?

I'm considering changing how we sent data to SSEs, but I want to understand where the current approach fails in more detail, with reproducible examples.

@lgrammel lgrammel changed the title fix: update Hono examples to use correct headers for streaming fix: update Hono examples to use the text/event-stream content type Feb 5, 2025
@lgrammel lgrammel changed the title fix: update Hono examples to use the text/event-stream content type fix (docs): update Hono examples to use the text/event-stream content type Feb 5, 2025
@entelligence-ai-reviews
Copy link

Walkthrough

Updated Content-Type headers from text/plain; charset=utf-8 to text/event-stream in 30-hono.mdx and server.ts files.

Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts below

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:
    @bot + *your message*
Example: @bot Can you suggest improvements for this code?
  • Help the Bot learn by providing feedback on its responses.
    @bot + *feedback*
Example: @bot Do not comment on `save_auth` function !

@lgrammel
Copy link
Collaborator

lgrammel commented Feb 6, 2025

@entelligence-ai-reviews who enabled this? please disable this bot. we did not ask for this.

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.

3 participants