diff --git a/server/authorization.go b/server/authorization.go index b3a3cae1..5112f8ad 100644 --- a/server/authorization.go +++ b/server/authorization.go @@ -270,7 +270,7 @@ func (a *AuthorizationServer) createDenyResponse(req *envoy_auth.CheckRequest, t RequestPath: requestPath, RequestVerb: req.Attributes.Request.Http.Method, UserAgent: req.Attributes.Request.Http.Headers["User-Agent"], - ResponseStatusCode: int(code), + ResponseStatusCode: int(tracker.statusCode), GatewaySource: gatewaySource, ClientIP: req.Attributes.Request.Http.Headers["X-Forwarded-For"], } diff --git a/server/authorization_test.go b/server/authorization_test.go index eb1c98c5..378ae2d0 100644 --- a/server/authorization_test.go +++ b/server/authorization_test.go @@ -424,7 +424,7 @@ func TestImmediateAnalytics(t *testing.T) { ClientIP: headers["X-Forwarded-For"], UserAgent: headers["User-Agent"], APIProxyRevision: 0, - ResponseStatusCode: int(rpc.PERMISSION_DENIED), + ResponseStatusCode: http.StatusForbidden, DeveloperEmail: ac.DeveloperEmail, DeveloperApp: ac.Application, AccessToken: ac.AccessToken,