Fix delegator return value for single hijacker

Previously, the pickDelegator function was not returning a
*hijackerDelegator so the return value did not implement the Hijacker
interface. As a result, code that attempts to hijack the connection
would fail when using a type assertion.

All the other cases returned the hijackerDelegator correctly.
This commit is contained in:
Torin Sandall 2018-02-01 10:57:42 -08:00
parent f4fb1b73fb
commit 44a8a1218c
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ func init() {
}{d, &flusherDelegator{d}, &closeNotifierDelegator{d}}
}
pickDelegator[hijacker] = func(d *responseWriterDelegator) delegator { // 4
return hijackerDelegator{d}
return &hijackerDelegator{d}
}
pickDelegator[hijacker+closeNotifier] = func(d *responseWriterDelegator) delegator { // 5
return struct {