summaryrefslogtreecommitdiff
path: root/web.go
diff options
context:
space:
mode:
Diffstat (limited to 'web.go')
-rw-r--r--web.go26
1 files changed, 0 insertions, 26 deletions
diff --git a/web.go b/web.go
deleted file mode 100644
index b64c1de..0000000
--- a/web.go
+++ /dev/null
@@ -1,26 +0,0 @@
1package main
2
3import (
4 "fmt"
5 "net/http"
6 "net/url"
7)
8
9func makeURL(r *http.Request, path string, subs ...interface{}) *url.URL {
10 scheme := "https"
11 if r.TLS == nil {
12 scheme = "http"
13 }
14
15 // Always defer to whatever the proxy told us it was doing because this
16 // could be a mullet-VIP in either direction.
17 if fwProto := r.Header.Get("X-Forwarded-Proto"); fwProto != "" {
18 scheme = fwProto
19 }
20
21 return &url.URL{
22 Scheme: scheme,
23 Host: r.Host,
24 Path: fmt.Sprintf(path, subs...),
25 }
26}