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: use event.handled guard before sending response #1326

Merged
merged 1 commit into from
Jun 20, 2023
Merged

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jun 20, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Use the new h3 event.handled flag (unjs/h3#410) to guard node.res.end calls and avoid responding to an already ended request similar to unjs/h3#411

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pi0 pi0 changed the title fix: use event.handled guard before sending direct reponses fix: use event.handled guard before sending response Jun 20, 2023
@pi0
Copy link
Member Author

pi0 commented Jun 20, 2023

/cc @danielroe We probably need to do the same for nuxt error handler for consistency.

@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Merging #1326 (3e383f5) into main (46e6f10) will decrease coverage by 0.05%.
The diff coverage is 16.66%.

@@            Coverage Diff             @@
##             main    #1326      +/-   ##
==========================================
- Coverage   76.59%   76.54%   -0.05%     
==========================================
  Files          70       70              
  Lines        7117     7121       +4     
  Branches      706      706              
==========================================
  Hits         5451     5451              
- Misses       1665     1669       +4     
  Partials        1        1              
Impacted Files Coverage Ξ”
src/dev/error.ts 10.20% <16.66%> (-0.91%) ⬇️

@pi0 pi0 merged commit 34d9d1d into main Jun 20, 2023
@pi0 pi0 deleted the fix/h3-handled branch June 20, 2023 22:47
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.

1 participant