Skip to content

Fix keymanager fee recipient response validation - #1351

Open
hehuanlu wants to merge 1 commit into
rocket-pool:masterfrom
hehuanlu:my_feature
Open

hehuanlu wants to merge 1 commit into
rocket-pool:masterfrom
hehuanlu:my_feature

Conversation

@hehuanlu

Copy link
Copy Markdown

Summary

Validate the keymanager GET response before deciding whether a validator's fee recipient needs to be updated. A non-2xx response now returns an error with the HTTP status and at most 4 KiB of response text instead of being interpreted as an empty fee recipient and followed by a POST.

The helper also closes the response body when reading or decoding fails.

Testing

  • go test ./shared/services/rocketpool -run TestReadFeeRecipientResponse -count=1
  • Added cases for a valid response, HTTP 401, and malformed JSON.

Signed-off-by: hehuanlu <hehuanlu@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant