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

agent/form_uploader: Implement HTTP Request debug #1149

Merged
merged 1 commit into from
Jan 29, 2020

Conversation

ticky
Copy link
Contributor

@ticky ticky commented Jan 21, 2020

This completes the implementation of the DebugHTTP option, which we describe as "dumps all request and response bodies to the log".

It previously did not dump request bodies made by the form_uploader, only their responses.

Implementation borrowed from api/client, which already handled this similarly.

This completes the implementation of the `DebugHTTP` option, which we describe as "dumps all request and response bodies to the log".

It previously did not dump request bodies made by the form_uploader, only their responses.

Implementation borrowed from `api/client`, which already handled this similarly.
@ticky ticky requested a review from a team January 21, 2020 21:35
requestDump, err = httputil.DumpRequestOut(request, true)
}

u.logger.Debug("\nERR: %s\n%s", err, string(requestDump))
Copy link
Member

Choose a reason for hiding this comment

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

Is this log output in the right order? Should we be showing the request dump first then the error? Or is this how the other places do it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It’s the same order as the other instance in this file:

if u.conf.DebugHTTP {
responseDump, err := httputil.DumpResponse(response, true)
u.logger.Debug("\nERR: %s\n%s", err, string(responseDump))
}

@pda pda merged commit 3aa6152 into master Jan 29, 2020
@pda pda deleted the http-request-debug-in-form-uploader branch January 29, 2020 12:46
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.

3 participants