Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pro client request middleware #1107

Merged
merged 5 commits into from
Jun 24, 2024
Merged

Conversation

atavism
Copy link
Contributor

@atavism atavism commented Jun 24, 2024

This PR updates defaultwebclient to use a different type of request middleware where RawRequest is not nil.

go-resty has "three types of request middleware, and they are performed in sequence:

  • udBeforeRequest chain (registered by Client.onBeforeRequest)
  • beforeRequest chain (default middleware registered by resty)
  • preReqHook hook (registered by Client.SetPreRequestHook)

RawRequest is initialized at the second chain. Therefore, we get nil in our onBeforeRequest function."

@atavism atavism requested a review from jigar-f June 24, 2024 06:49
@jigar-f
Copy link
Contributor

jigar-f commented Jun 24, 2024

Reviewing.

internalsdk/pro/pro.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jigar-f jigar-f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!, Just one comment.

@atavism
Copy link
Contributor Author

atavism commented Jun 24, 2024

Thanks for the review, @jigar-f!

@atavism atavism merged commit a85fcd5 into main Jun 24, 2024
1 check passed
@atavism atavism deleted the atavism/pro-client-updates branch June 24, 2024 10:15
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.

2 participants