Closed axispx closed 2 years ago
Hi @anarchyrucks. I am thinking the Intercept
method might be a bit more convenient instead of defining a http.Request, e.g.
apitest.Handler(handler).
Intercept(func(request *http.Request) {
request.RemoteAddr = "..."
}).
Get("/message").
Body(`{"message": "hi"}`).
Header("Content-Type", "application/json").
Expect(t).
Status(http.StatusOK).
End()
If you need to set RemoteAddr globally you could do it in your own builder method.
Closing due to inactivity.
Is your feature request related to a problem? Please describe. I didn't find a way to set the RemoteAddr when running tests which breaks my code where I need to split host and port.
Describe the solution you'd like Provide a builder method that sets a custom address for the test.
Describe alternatives you've considered I use http.Request to set the remote address as a workaround.