Remove the useless hijack call

This commit is contained in:
Melon 2023-08-24 16:03:45 +01:00
parent b5ff809345
commit 53041f4ac7
Signed by: melon
GPG Key ID: 6C9D970C50D26A25
2 changed files with 1 additions and 9 deletions

View File

@ -39,7 +39,7 @@ func (s *serveCmd) Usage() string {
` `
} }
func (s *serveCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { func (s *serveCmd) Execute(_ context.Context, _ *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
log.Println("[Violet] Starting...") log.Println("[Violet] Starting...")
if s.configPath == "" { if s.configPath == "" {

View File

@ -172,14 +172,6 @@ func (r Route) internalServeHTTP(rw http.ResponseWriter, req *http.Request) {
if resp.Body != nil { if resp.Body != nil {
_, err := io.Copy(rw, resp.Body) _, err := io.Copy(rw, resp.Body)
if err != nil { if err != nil {
// hijack and close upon error
if h, ok := rw.(http.Hijacker); ok {
hijack, _, err := h.Hijack()
if err != nil {
return
}
_ = hijack.Close()
}
return return
} }
} }