-
Notifications
You must be signed in to change notification settings - Fork 718
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
OnBeforeRequest does not change Request.RawRequest attributes #57
Comments
Thanks for reporting @ChristianLohmann. I will have a look. |
I had a look and understood what you have describe. I will correct the execution sequence of Please continue to modify the |
Many thanks for this quick reply and providing a fix that fast! |
Fix available on master branch. Please give it a try and let me know. |
Thanks, it works now! |
Thanks for the confirmation. I believe |
I haven't experienced any other issues with the master so far. I glued the commit hash to c53a09a with glide until a new release is available via gopkg.in. |
Thank you. I'm closing this issue. |
Trying to manipulate
*resty.Request
fields inside anOnBeforeRequest
function does not affect the actual request, which is finally executed:https://github.com/go-resty/resty/blob/master/client.go#L627-L645
All
OnBeforeRequest
functions will be executed but they have no effect when they call methods directly on*resty.Request
because theRawRequest
stays untouched until real request execution.For example setting an auth token header inside an
OnBeforeRequest
function won't work withAs a workaround one has to manipulate directly the
r.RawRequest
struct.The text was updated successfully, but these errors were encountered: