-
Notifications
You must be signed in to change notification settings - Fork 233
Open
Labels
feature requestNew feature or requestNew feature or requestproposalA proposal for an a new API or behavior. See CONTRIBUTING.md.A proposal for an a new API or behavior. See CONTRIBUTING.md.
Description
Following up on #522, where we discussed making it easier to modify HTTP client transport requests, for example by adding headers, we propose the following two new options:
type StreamableClientTransport struct {
...
// If set, ModifyRequest is called before each outgoing HTTP request made by the client
// connection. It can be use to, for example, add headers to outgoing requests.
ModifyRequest func(*http.Request)
}
type SSEClientTransport struct {
...
// <ditto>
ModifyRequest func(*http.Request)
}
We believe these options will make it easier to do things like add auth headers. Currently, this can be achieved using the HTTPClient
field, but only in the roundtripper, which requires cloning the request.
manuelibar
Metadata
Metadata
Assignees
Labels
feature requestNew feature or requestNew feature or requestproposalA proposal for an a new API or behavior. See CONTRIBUTING.md.A proposal for an a new API or behavior. See CONTRIBUTING.md.