mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-19 07:38:57 +08:00
Merge branch 'master' into mode-tc-2
This commit is contained in:
commit
37d28c7a22
@ -10,7 +10,6 @@ matrix:
|
||||
env: GO111MODULE=on
|
||||
- go: 1.13.x
|
||||
- go: master
|
||||
env: GO111MODULE=on
|
||||
|
||||
git:
|
||||
depth: 10
|
||||
|
12
README.md
12
README.md
@ -1678,11 +1678,19 @@ func main() {
|
||||
}
|
||||
|
||||
g.Go(func() error {
|
||||
return server01.ListenAndServe()
|
||||
err := server01.ListenAndServe()
|
||||
if err != nil && err != http.ErrServerClosed {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return err
|
||||
})
|
||||
|
||||
g.Go(func() error {
|
||||
return server02.ListenAndServe()
|
||||
err := server02.ListenAndServe()
|
||||
if err != nil && err != http.ErrServerClosed {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return err
|
||||
})
|
||||
|
||||
if err := g.Wait(); err != nil {
|
||||
|
@ -393,8 +393,7 @@ func (c *Context) QueryArray(key string) []string {
|
||||
|
||||
func (c *Context) getQueryCache() {
|
||||
if c.queryCache == nil {
|
||||
c.queryCache = make(url.Values)
|
||||
c.queryCache, _ = url.ParseQuery(c.Request.URL.RawQuery)
|
||||
c.queryCache = c.Request.URL.Query()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,7 +347,17 @@ func TestRenderRedirect(t *testing.T) {
|
||||
}
|
||||
|
||||
w = httptest.NewRecorder()
|
||||
assert.Panics(t, func() { assert.NoError(t, data2.Render(w)) })
|
||||
assert.PanicsWithValue(t, "Cannot redirect with status code 200", func() { data2.Render(w) })
|
||||
|
||||
data3 := Redirect{
|
||||
Code: http.StatusCreated,
|
||||
Request: req,
|
||||
Location: "/new/location",
|
||||
}
|
||||
|
||||
w = httptest.NewRecorder()
|
||||
err = data3.Render(w)
|
||||
assert.NoError(t, err)
|
||||
|
||||
// only improve coverage
|
||||
data2.WriteContentType(w)
|
||||
|
Loading…
x
Reference in New Issue
Block a user