Skip to content
Snippets Groups Projects
Commit a905e773 authored by Travis Ralston's avatar Travis Ralston
Browse files

Strip port off of host for easier configuration

parent 47ece80b
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
"os" "os"
"reflect" "reflect"
"strconv" "strconv"
"strings"
"time" "time"
"github.com/didip/tollbooth" "github.com/didip/tollbooth"
...@@ -123,6 +124,7 @@ func main() { ...@@ -123,6 +124,7 @@ func main() {
} }
func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
r.Host = strings.Split(r.Host, ":")[0]
contextLog := log.WithFields(log.Fields{ contextLog := log.WithFields(log.Fields{
"method": r.Method, "method": r.Method,
"host": r.Host, "host": r.Host,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment