From 01111b5258b2347ab8f4f3659753083fe809a65d Mon Sep 17 00:00:00 2001 From: Adnan Hajdarevic Date: Sun, 22 Dec 2019 22:37:44 +0100 Subject: [PATCH] Rename RemoteAddress to RemoteAddr. --- docs/Hook-Definition.md | 2 +- hook/hook.go | 2 +- webhook.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Hook-Definition.md b/docs/Hook-Definition.md index 9939ba4..14c17f6 100644 --- a/docs/Hook-Definition.md +++ b/docs/Hook-Definition.md @@ -26,7 +26,7 @@ Hooks are defined as JSON objects. Please note that in order to be considered va * `method` - HTTP(s) method used by the client (i.e. GET, POST, etc...) * `URI` - URI which client requested * `host` - value of the `Host` header sent by the client - * `remoteAddress` - client's IP address + * `remoteAddr` - client's IP address and port in the `IP:PORT` format * `query` - object with query parameters and their respective values * `headers` - object with headers and their respective values * `base64EncodedBody` - base64 encoded request body diff --git a/hook/hook.go b/hook/hook.go index 7fdf8ef..d8711b3 100644 --- a/hook/hook.go +++ b/hook/hook.go @@ -430,7 +430,7 @@ type PreHookContext struct { HookID string `json:"hookID"` Method string `json:"method"` Base64EncodedBody string `json:"base64EncodedBody"` - RemoteAddress string `json:"remoteAddress"` + RemoteAddr string `json:"remoteAddr"` URI string `json:"URI"` Host string `json:"host"` Headers http.Header `json:"headers"` diff --git a/webhook.go b/webhook.go index 3ce52dd..467c784 100644 --- a/webhook.go +++ b/webhook.go @@ -256,7 +256,7 @@ func hookHandler(w http.ResponseWriter, r *http.Request) { HookID: matchedHook.ID, Method: r.Method, Base64EncodedBody: base64.StdEncoding.EncodeToString(body), - RemoteAddress: r.RemoteAddr, + RemoteAddr: r.RemoteAddr, URI: r.RequestURI, Host: r.Host, Headers: r.Header,