Skip to content

Commit

Permalink
Checking if the server is TLS is not needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignaciojeria authored and dylanhitt committed Dec 4, 2024
1 parent b81c45a commit 068ae9f
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"net"
"net/http"
"os"
"reflect"
"slices"
"time"

Expand Down Expand Up @@ -371,19 +370,10 @@ func WithoutLogger() func(*Server) {
// )
func WithListener(listener net.Listener) func(*Server) {
return func(s *Server) {
s.isTLS = isTLSListener(listener)
s.listener = listener
}
}

func isTLSListener(listener net.Listener) bool {
listenerType := reflect.TypeOf(listener)
if listenerType != nil && listenerType.String() == "*tls.listener" {
return true
}
return false
}

func WithOpenAPIConfig(openapiConfig OpenAPIConfig) func(*Server) {
return func(s *Server) {
if openapiConfig.JsonUrl != "" {
Expand Down

0 comments on commit 068ae9f

Please sign in to comment.