authorize: add request id to context (#3497)

* authorize: add request id to context

* fix context keys
This commit is contained in:
Caleb Doxsey 2022-07-26 14:34:48 -06:00 committed by GitHub
parent 06ee1c8711
commit 89a105c8e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 9 deletions

View file

@ -322,13 +322,20 @@ func TestLoadBalancer(t *testing.T) {
if !assert.NoError(t, err) {
return distribution
}
defer res.Body.Close()
bs, err := io.ReadAll(res.Body)
if !assert.NoError(t, err) {
return distribution
}
var result struct {
Hostname string `json:"hostname"`
}
err = json.NewDecoder(res.Body).Decode(&result)
_ = res.Body.Close()
assert.NoError(t, err)
err = json.Unmarshal(bs, &result)
if !assert.NoError(t, err, "invalid json: %s", bs) {
return distribution
}
distribution[result.Hostname]++
}