-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAge
Milestone
Description
(net/http).Request is populated vastly differently on the client and server sides.
That's probably not fixable, given Go1 compatibility.
But it causes problems when testing http handlers - httptest.ResponseRecorder needs a Request to go with it, and the obvious candidate (http.NewRequest) generates the client-side version, not the server-side version.
You can get the server-side version by setting up an httptest.Server and making a request to it, but that involves a lot of boilerplate and some syscalls.
It would be nice if there were a way (in the http or httptest package) to get a Request in the server-side format without having to go through the whole HTTP stack with a real server.
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAge