Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
Oops
Matthew Holt committed
Jun 21, 2019 at 08:52 UTC
81a9e125b54b34d453c425dbd58a3270b9568dca
3 files changed
+3
-3
modules/caddyhttp/templates/tplcontext.go
+1
-1
@@ -120,7 +120,7 @@ func (c templateContext) Cookie(name string) string {
120
// Hostname gets the (remote) hostname of the client making the request.
121
// Performance warning: This involves a DNS lookup.
122
func (c templateContext) Hostname() string {
123
- ip := c.IP()
123
+ ip := c.RemoteIP()
124
125
hostnameList, err := net.LookupAddr(ip)
126
if err != nil || len(hostnameList) == 0 {
modules/caddyhttp/templates/tplcontext_test.go
+1
-1
@@ -122,7 +122,7 @@ func TestIP(t *testing.T) {
122
{`[fe80:1::3%eth0]:44`, `fe80:1::3%eth0`},
123
} {
124
context.Req.RemoteAddr = test.inputRemoteAddr
125
- if actual := context.IP(); actual != test.expect {
125
+ if actual := context.RemoteIP(); actual != test.expect {
126
t.Errorf("Test %d: Expected %s but got %s", i, test.expect, actual)
127
}
128
}
modules/caddytls/tls.go
+1
-1
@@ -197,7 +197,7 @@ type AutomationConfig struct {
197
// management of managed TLS certificates.
198
type AutomationPolicy struct {
199
Hosts []string `json:"hosts,omitempty"`
200
- ManagementRaw json.RawMessage `json:"management"`
200
+ ManagementRaw json.RawMessage `json:"management,omitempty"`
201
202
Management managerMaker `json:"-"`
203
}