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

Support (*http.ResponseController).Hijack() #455

Closed
gz-95 opened this issue Jul 10, 2024 · 1 comment · Fixed by #472
Closed

Support (*http.ResponseController).Hijack() #455

gz-95 opened this issue Jul 10, 2024 · 1 comment · Fixed by #472

Comments

@gz-95
Copy link

gz-95 commented Jul 10, 2024

Currently the library checks http.ResponseWriter for http.Hijacker support via type assertion.

Is there a possibility we can use (*http.ResponseController).Hijack() instead? This way we can support http.ResponseWriter types that don't offer http.Hijacker interface but their underlying unwrapped writers do.

@mafredri
Copy link
Member

Thanks for bringing this up, we'll have to update the minimum Go version to 1.20 or make an exception for 1.19, but this seems like a reasonable request 👍🏻.

mafredri added a commit that referenced this issue Aug 21, 2024
Since we rely on the connection not being hijacked too early (i.e.
detecting the presence of http.Hijacker) to set headers, we must
manually implement the unwrapping of the http.ResponseController. By
doing so, we also retain Go 1.19 compatibility without build tags.

Fixes #455
mafredri added a commit that referenced this issue Aug 21, 2024
Since we rely on the connection not being hijacked too early (i.e.
detecting the presence of http.Hijacker) to set headers, we must
manually implement the unwrapping of the http.ResponseController. By
doing so, we also retain Go 1.19 compatibility without build tags.

Closes #455
mafredri added a commit that referenced this issue Aug 21, 2024
Since we rely on the connection not being hijacked too early (i.e.
detecting the presence of http.Hijacker) to set headers, we must
manually implement the unwrapping of the http.ResponseController. By
doing so, we also retain Go 1.19 compatibility without build tags.

Closes #455
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants