Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent panic in Context.GetQuery() when there is no Request
I have an endpoint that uses an optional query parameter via DefaultQuery(). In one unit test case I want to test the route with that parameter. I write that test as ```go w := httptest.NewRecorder() c, _ := gin.CreateTestContext(w) routeHandler(c) ``` And this panics when routeHandler() calls c.DefaultQuery() because c.Request == nil.
- Loading branch information