hono icon indicating copy to clipboard operation
hono copied to clipboard

fix(hono/context): content-type be overridden by default response when append headers

Open xx1124961758 opened this issue 7 months ago • 5 comments

fix node-server bug https://github.com/honojs/node-server/issues/226

  • [x] Add tests
  • [x] Run tests
  • [x] bun run format:fix && bun run lint:fix to format the code
  • [ ] Add TSDoc/JSDoc to document the code

xx1124961758 avatar May 31 '25 12:05 xx1124961758

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.35%. Comparing base (4eb7979) to head (564a243). Report is 46 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4182      +/-   ##
==========================================
+ Coverage   91.31%   91.35%   +0.03%     
==========================================
  Files         168      168              
  Lines       10790    10707      -83     
  Branches     3067     3088      +21     
==========================================
- Hits         9853     9781      -72     
+ Misses        936      925      -11     
  Partials        1        1              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar May 31 '25 12:05 codecov[bot]

@xx1124961758 cc: @yusukebe This is just for your information, but it's likely related to this issue as well:

  • https://github.com/honojs/hono/issues/3736#issuecomment-2814695601

sushichan044 avatar May 31 '25 13:05 sushichan044

Hi @xx1124961758 Thank you for the PR. I've left the comments.

@sushichan044 Do you think this PR will fix #3736? If so, please review this. You may know the PR #4100 can fix the problem, but I'm not sure we have to merge #4100. So, currently, it's a good idea to use this PR.

yusukebe avatar May 31 '25 20:05 yusukebe

@yusukebe I also think this pull request can fix the behavior reported in the issue. However, as you said, #4100 is necessary for a fundamental solution. Anyway, I'll review this PR.

sushichan044 avatar Jun 01 '25 02:06 sushichan044

@xx1124961758 To make things clearer, we should also note in a comment that this fix is an ad-hoc workaround for issue #3736. This conditional branch is special handling, and it's difficult to understand the reasoning behind it without knowing the background.

sushichan044 avatar Jun 01 '25 03:06 sushichan044

The #4100 was merged. This can be closed. Thank you!

yusukebe avatar Jul 02 '25 22:07 yusukebe