mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-22 16:46:53 +01:00
Oops
This commit is contained in:
parent
70c788ce0c
commit
81a9e125b5
3 changed files with 3 additions and 3 deletions
|
@ -120,7 +120,7 @@ func (c templateContext) Cookie(name string) string {
|
||||||
// Hostname gets the (remote) hostname of the client making the request.
|
// Hostname gets the (remote) hostname of the client making the request.
|
||||||
// Performance warning: This involves a DNS lookup.
|
// Performance warning: This involves a DNS lookup.
|
||||||
func (c templateContext) Hostname() string {
|
func (c templateContext) Hostname() string {
|
||||||
ip := c.IP()
|
ip := c.RemoteIP()
|
||||||
|
|
||||||
hostnameList, err := net.LookupAddr(ip)
|
hostnameList, err := net.LookupAddr(ip)
|
||||||
if err != nil || len(hostnameList) == 0 {
|
if err != nil || len(hostnameList) == 0 {
|
||||||
|
|
|
@ -122,7 +122,7 @@ func TestIP(t *testing.T) {
|
||||||
{`[fe80:1::3%eth0]:44`, `fe80:1::3%eth0`},
|
{`[fe80:1::3%eth0]:44`, `fe80:1::3%eth0`},
|
||||||
} {
|
} {
|
||||||
context.Req.RemoteAddr = test.inputRemoteAddr
|
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)
|
t.Errorf("Test %d: Expected %s but got %s", i, test.expect, actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,7 @@ type AutomationConfig struct {
|
||||||
// management of managed TLS certificates.
|
// management of managed TLS certificates.
|
||||||
type AutomationPolicy struct {
|
type AutomationPolicy struct {
|
||||||
Hosts []string `json:"hosts,omitempty"`
|
Hosts []string `json:"hosts,omitempty"`
|
||||||
ManagementRaw json.RawMessage `json:"management"`
|
ManagementRaw json.RawMessage `json:"management,omitempty"`
|
||||||
|
|
||||||
Management managerMaker `json:"-"`
|
Management managerMaker `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue