summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-06-21 08:52:15 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-06-21 08:52:15 -0600
commit81a9e125b54b34d453c425dbd58a3270b9568dca (patch)
treee077fefe035375f810af3e0a255042e23532d7cd
parent70c788ce0c7f81f87d19850164031ce2e8158e72 (diff)
Oops
-rw-r--r--modules/caddyhttp/templates/tplcontext.go2
-rw-r--r--modules/caddyhttp/templates/tplcontext_test.go2
-rw-r--r--modules/caddytls/tls.go2
3 files changed, 3 insertions, 3 deletions
diff --git a/modules/caddyhttp/templates/tplcontext.go b/modules/caddyhttp/templates/tplcontext.go
index d89f106..19bf714 100644
--- a/modules/caddyhttp/templates/tplcontext.go
+++ b/modules/caddyhttp/templates/tplcontext.go
@@ -120,7 +120,7 @@ func (c templateContext) Cookie(name string) string {
// Hostname gets the (remote) hostname of the client making the request.
// Performance warning: This involves a DNS lookup.
func (c templateContext) Hostname() string {
- ip := c.IP()
+ ip := c.RemoteIP()
hostnameList, err := net.LookupAddr(ip)
if err != nil || len(hostnameList) == 0 {
diff --git a/modules/caddyhttp/templates/tplcontext_test.go b/modules/caddyhttp/templates/tplcontext_test.go
index efe5374..88adb5b 100644
--- a/modules/caddyhttp/templates/tplcontext_test.go
+++ b/modules/caddyhttp/templates/tplcontext_test.go
@@ -122,7 +122,7 @@ func TestIP(t *testing.T) {
{`[fe80:1::3%eth0]:44`, `fe80:1::3%eth0`},
} {
context.Req.RemoteAddr = test.inputRemoteAddr
- if actual := context.IP(); actual != test.expect {
+ if actual := context.RemoteIP(); actual != test.expect {
t.Errorf("Test %d: Expected %s but got %s", i, test.expect, actual)
}
}
diff --git a/modules/caddytls/tls.go b/modules/caddytls/tls.go
index c84118a..63bc21d 100644
--- a/modules/caddytls/tls.go
+++ b/modules/caddytls/tls.go
@@ -197,7 +197,7 @@ type AutomationConfig struct {
// management of managed TLS certificates.
type AutomationPolicy struct {
Hosts []string `json:"hosts,omitempty"`
- ManagementRaw json.RawMessage `json:"management"`
+ ManagementRaw json.RawMessage `json:"management,omitempty"`
Management managerMaker `json:"-"`
}