Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
internal/server: lowercase the x-forwarded-proto header value
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Sep 24, 2021
1 parent ca98037 commit c407788
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/server/http_tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package server

import (
"net/http"
"strings"
)

// Proto header to read for the forwarded proto
Expand All @@ -13,7 +14,7 @@ func forceTLSHandler(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
scheme := r.URL.Scheme
if v := r.Header.Get(xForwardedProto); v != "" {
scheme = v
scheme = strings.ToLower(v)
}

if scheme != "https" {
Expand Down

0 comments on commit c407788

Please sign in to comment.