Skip to content

Commit c9bee0b

Browse files
committed
chore: Ip -> IP
1 parent 627a1b2 commit c9bee0b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

middleware.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ type HTTPRequest struct {
166166
Status int `json:"status"`
167167
ResponseSize string `json:"responseSize"`
168168
UserAgent string `json:"userAgent"`
169-
RemoteIp string `json:"remoteIp"`
170-
ServerIp string `json:"serverIp"`
169+
RemoteIP string `json:"remoteIp"`
170+
ServerIP string `json:"serverIp"`
171171
Referer string `json:"referer"`
172172
Latency string `json:"latency"`
173173
CacheLookup bool `json:"cacheLookup"`
@@ -196,8 +196,8 @@ func writeRequestLog(r *http.Request, config *Config, status int, responseSize i
196196
Status: status,
197197
ResponseSize: fmt.Sprintf("%d", responseSize),
198198
UserAgent: r.UserAgent(),
199-
RemoteIp: getRemoteIp(r),
200-
ServerIp: getServerIp(),
199+
RemoteIP: getRemoteIP(r),
200+
ServerIP: getServerIP(),
201201
Referer: r.Referer(),
202202
Latency: fmt.Sprintf("%fs", elapsed.Seconds()),
203203
CacheLookup: false,
@@ -220,12 +220,12 @@ func writeRequestLog(r *http.Request, config *Config, status int, responseSize i
220220
return err
221221
}
222222

223-
func getRemoteIp(r *http.Request) string {
223+
func getRemoteIP(r *http.Request) string {
224224
parts := strings.Split(r.RemoteAddr, ":")
225225
return parts[0]
226226
}
227227

228-
func getServerIp() string {
228+
func getServerIP() string {
229229
ifaces, err := net.Interfaces()
230230
if err != nil {
231231
return ""

stackdriver_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestIntegration(t *testing.T) {
5252

5353
opts := []cmp.Option{
5454
cmpopts.IgnoreFields(HTTPRequestLog{}, "Time", "Trace"),
55-
cmpopts.IgnoreFields(HTTPRequest{}, "RemoteIp", "ServerIp", "Latency"),
55+
cmpopts.IgnoreFields(HTTPRequest{}, "RemoteIP", "ServerIP", "Latency"),
5656
}
5757
expected := HTTPRequestLog{
5858
Severity: "ERROR",
@@ -149,7 +149,7 @@ func TestNoContextLog(t *testing.T) {
149149

150150
opts := []cmp.Option{
151151
cmpopts.IgnoreFields(HTTPRequestLog{}, "Time", "Trace"),
152-
cmpopts.IgnoreFields(HTTPRequest{}, "RemoteIp", "ServerIp", "Latency"),
152+
cmpopts.IgnoreFields(HTTPRequest{}, "RemoteIP", "ServerIP", "Latency"),
153153
}
154154
expected := HTTPRequestLog{
155155
Severity: "DEFAULT",

0 commit comments

Comments
 (0)