net/http/httptrace: Provide direction in the documentation for ClientTrace on safety of request mutations #39153
Labels
Documentation
Issues describing a change to documentation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The documentation for
ClientTrace
provides no guidance on if it is safe to modify the request from within any of the trace functions. It mentions that the functions withinClientTrace
may be called concurrently, but does not comment on if these functions are permitted to modify the request. In contrast, the documentation for RoundTripper explicitly calls out the expected behavior:This concern was originally raised when attempting to use
GotConn
to modify the requestHeader
to add the amount of time remaining until the request's context deadline, for use in distributed tracing. I would like to be able to modify certain properties in the request (Headers, Body, ...) in response toClientTrace
data, but need to understand if that behavior will continue to be supported.This issue has two components:
ClientTrace
are permitted to modify the requestClientTrace
are permitted to modify the request, promise this expectation will continue in the future by updating the documentation to reflect thisThe text was updated successfully, but these errors were encountered: