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(helper/proxy): missing proxy response status #3927

Merged
merged 2 commits into from
Feb 18, 2025

Conversation

BarryThePenguin
Copy link
Contributor

@BarryThePenguin BarryThePenguin commented Feb 17, 2025

  • add failing test
  • find out why the response status is missing (default value of 200)

Turns out that Request and Response classes do not have enumerable properties, so using the spread operator yields an empty object 🤯

console.log({ ...new Request('http://a') }) // {}
console.log({ ...new Response(null) }) // {}

I haven't found where this is mentioned in the standards documentation 😩

fixes #3926

Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.29%. Comparing base (6ae0213) to head (bf97711).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3927   +/-   ##
=======================================
  Coverage   91.29%   91.29%           
=======================================
  Files         168      168           
  Lines       10774    10775    +1     
  Branches     3095     3036   -59     
=======================================
+ Hits         9836     9837    +1     
  Misses        937      937           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe
Copy link
Member

Hi @BarryThePenguin

Looks good to me. But it has conflict. Can you resolve it?

@usualoma
Copy link
Member

Thank you!

@BarryThePenguin BarryThePenguin force-pushed the fix/proxy-response-status branch from b3a26a9 to bf97711 Compare February 17, 2025 07:39
@yusukebe
Copy link
Member

@BarryThePenguin

Thanks! Merging now.

@yusukebe yusukebe merged commit 35fccf2 into honojs:main Feb 18, 2025
16 checks passed
@BarryThePenguin BarryThePenguin deleted the fix/proxy-response-status branch February 18, 2025 21:09
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.

hono/proxy does not preserve response.status
3 participants