• Sean McGivern's avatar
    Fix API client_id logging on error · cb171149
    Sean McGivern authored
    Gitlab::ApplicationContext has a bit of a sharp edge: `client_id` will
    not be correctly computed unless `remote_ip` and `user` are both set or
    both missing in the innermost context.
    
    In the case here, with an API error, we'd try to set `user` but not
    `remote_ip`. This would give a correct `client_id` when the request was
    authenticated, but when it was anonymous we would get a `client_id` of
    'ip/', even though the `remote_ip` was set in an outer context.
    cb171149
api_spec.rb 9.98 KB