Skip to content

Commit

Permalink
check for h1 and h2 listener netw
Browse files Browse the repository at this point in the history
  • Loading branch information
MayCXC committed Sep 27, 2024
1 parent 04bb55c commit b98bf1a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/caddyhttp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,10 @@ func (app *App) Start() error {
if err != nil {
return fmt.Errorf("listening on %s: %v", listenAddr.At(portOffset), err)
}
ln := lnAny.(net.Listener)
ln, ok := lnAny.(net.Listener)
if !ok {
return fmt.Errorf("network '%s' cannot handle HTTP/1 or HTTP/2 connections", listenAddr.Network)
}

if useTLS {
// create TLS listener - this enables and terminates TLS
Expand Down

0 comments on commit b98bf1a

Please sign in to comment.