Skip to content

Only mark hijacked on successful hijack#80

Merged
tigerwill90 merged 1 commit into
masterfrom
fix/hijack-state-on-error
Apr 13, 2026
Merged

Only mark hijacked on successful hijack#80
tigerwill90 merged 1 commit into
masterfrom
fix/hijack-state-on-error

Conversation

@tigerwill90
Copy link
Copy Markdown
Collaborator

@tigerwill90 tigerwill90 commented Apr 13, 2026

recorder.Hijack previously set hijacked = true before checking the hijacker's return value. If the underlying hijacker returned http.ErrNotSupported or http.ErrHijacked, the recorder would still be marked as hijacked, causing subsequent Write/WriteHeader calls to wrongly fail with http.ErrHijacked. The flag is now only set when Hijack actually succeeds.

@tigerwill90 tigerwill90 requested a review from pawndev April 13, 2026 08:36
@tigerwill90 tigerwill90 changed the title fix(response_writer): only mark hijacked on successful hijack Only mark hijacked on successful hijack Apr 13, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tigerwill90 tigerwill90 merged commit a696e0d into master Apr 13, 2026
4 checks passed
@tigerwill90 tigerwill90 deleted the fix/hijack-state-on-error branch April 13, 2026 19:50
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.

2 participants