Skip to content

Commit

Permalink
dont export internal func
Browse files Browse the repository at this point in the history
  • Loading branch information
lanrat committed Jan 9, 2021
1 parent 9b99e9e commit c3281b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (s *Server) Start() error {
timeoutDuration := time.Duration(s.apiConfig.APITimeout) * time.Second
// prep proxy handler
h := handlers.ProxyHeaders(s.router)
h = SetProxyURLHost(h)
h = setProxyURLHost(h)
// setup logging
h = handlers.LoggingHandler(os.Stdout, h)
// add recovery
Expand Down
4 changes: 2 additions & 2 deletions server/server_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"gopkg.in/throttled/throttled.v2/store/memstore"
)

// SetProxyURLHost
// setProxyURLHost
// should be called AFTER handlers.ProxyHeaders
// this fixes a bug with the proxy headers not setting the correct host
// https://github.com/gorilla/handlers/pull/178
func SetProxyURLHost(next http.Handler) http.Handler {
func setProxyURLHost(next http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
r.URL.Host = r.Host
next.ServeHTTP(w, r)
Expand Down

0 comments on commit c3281b8

Please sign in to comment.