summaryrefslogtreecommitdiff
path: root/internal/gitlabnet/accessverifier/client.go
diff options
context:
space:
mode:
authorIgor Drozdov <idrozdov@gitlab.com>2020-07-31 12:58:42 +0000
committerIgor Drozdov <idrozdov@gitlab.com>2020-07-31 12:58:42 +0000
commite0a8b72bc3a9dbfcbe4d32be08f66efb12f24bcd (patch)
tree6a28feda2a62ec88e889593d7fbf3ae950659e35 /internal/gitlabnet/accessverifier/client.go
parent701ebca0b5d4a8451afe677c3bdb19cc92a5a2f0 (diff)
parent87402ed127d9855b8123e5e08a4c89d373cc79e8 (diff)
downloadgitlab-shell-e0a8b72bc3a9dbfcbe4d32be08f66efb12f24bcd.tar.gz
Merge branch 'sh-inject-and-log-correlation-di' into 'master'
Generate and log correlation IDs See merge request gitlab-org/gitlab-shell!400
Diffstat (limited to 'internal/gitlabnet/accessverifier/client.go')
-rw-r--r--internal/gitlabnet/accessverifier/client.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/gitlabnet/accessverifier/client.go b/internal/gitlabnet/accessverifier/client.go
index 234e854..00b9d76 100644
--- a/internal/gitlabnet/accessverifier/client.go
+++ b/internal/gitlabnet/accessverifier/client.go
@@ -65,6 +65,7 @@ type Response struct {
ConsoleMessages []string `json:"gl_console_messages"`
Who string
StatusCode int
+ CorrelationID string
}
func NewClient(config *config.Config) (*Client, error) {
@@ -109,6 +110,8 @@ func parse(hr *http.Response, args *commandargs.Shell) (*Response, error) {
}
response.StatusCode = hr.StatusCode
+ // We expect the same correlation ID that we sent
+ response.CorrelationID = hr.Header.Get("X-Request-Id")
return response, nil
}