Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
  • Loading branch information
francislavoie and mholt committed Jan 6, 2022
1 parent c7d1999 commit 5caa1ab
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion modules/caddyhttp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (app *App) Start() error {
// create HTTP redirect wrapper, which detects if
// the request had HTTP bytes on the HTTPS port, and
// triggers a redirect if so.
ln = NewHttpRedirectListener(ln)
ln = &httpRedirectListener{Listener: ln}

// create TLS listener
tlsCfg := srv.TLSConnPolicies.TLSConfig(app.ctx)
Expand Down
6 changes: 0 additions & 6 deletions modules/caddyhttp/httpredirectlistener.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ type httpRedirectListener struct {
net.Listener
}

// NewHttpRedirectListener wraps inner, handling
func NewHttpRedirectListener(inner net.Listener) net.Listener {
l := &httpRedirectListener{Listener: inner}
return l
}

// Accept waits for and returns the next connection to the listener,
// wrapping it with a httpRedirectConn.
func (l *httpRedirectListener) Accept() (net.Conn, error) {
Expand Down

0 comments on commit 5caa1ab

Please sign in to comment.