Skip to content
This repository was archived by the owner on Oct 19, 2022. It is now read-only.

Commit 4b68a5f

Browse files
chore: update go.mod and remove space from copyright (gin-gonic#3158)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent ed03102 commit 4b68a5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+129
-126
lines changed

any.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Gin Core Team. All rights reserved.
1+
// Copyright 2022 Gin Core Team. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

auth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

auth_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

benchmarks_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/any.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Gin Core Team. All rights reserved.
1+
// Copyright 2022 Gin Core Team. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/binding.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/binding_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/default_validator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/default_validator_benchmark_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright 2022 Gin Core Team. All rights reserved.
2+
// Use of this source code is governed by a MIT style
3+
// license that can be found in the LICENSE file.
4+
15
package binding
26

37
import (

binding/form.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/form_mapping.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/form_mapping_benchmark_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Gin Core Team. All rights reserved.
1+
// Copyright 2019 Gin Core Team. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/header.go

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright 2022 Gin Core Team. All rights reserved.
2+
// Use of this source code is governed by a MIT style
3+
// license that can be found in the LICENSE file.
4+
15
package binding
26

37
import (

binding/json.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/msgpack.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/multipart_form_mapping.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Gin Core Team. All rights reserved.
1+
// Copyright 2019 Gin Core Team. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/multipart_form_mapping_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Gin Core Team. All rights reserved.
1+
// Copyright 2019 Gin Core Team. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/protobuf.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/query.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/toml.go

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright 2022 Gin Core Team. All rights reserved.
2+
// Use of this source code is governed by a MIT style
3+
// license that can be found in the LICENSE file.
4+
15
package binding
26

37
import (

binding/validate_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/xml.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

binding/yaml.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Gin Core Team. All rights reserved.
1+
// Copyright 2018 Gin Core Team. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

context.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

context_1.16_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Gin Core Team. All rights reserved.
1+
// Copyright 2021 Gin Core Team. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

context_1.17_test.go

+40-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Gin Core Team. All rights reserved.
1+
// Copyright 2021 Gin Core Team. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

@@ -17,6 +17,16 @@ import (
1717
"github.com/stretchr/testify/assert"
1818
)
1919

20+
type interceptedWriter struct {
21+
ResponseWriter
22+
b *bytes.Buffer
23+
}
24+
25+
func (i interceptedWriter) WriteHeader(code int) {
26+
i.Header().Del("X-Test")
27+
i.ResponseWriter.WriteHeader(code)
28+
}
29+
2030
func TestContextFormFileFailed17(t *testing.T) {
2131
buf := new(bytes.Buffer)
2232
mw := multipart.NewWriter(buf)
@@ -31,3 +41,32 @@ func TestContextFormFileFailed17(t *testing.T) {
3141
assert.Nil(t, f)
3242
})
3343
}
44+
45+
func TestInterceptedHeader(t *testing.T) {
46+
w := httptest.NewRecorder()
47+
c, r := CreateTestContext(w)
48+
49+
r.Use(func(c *Context) {
50+
i := interceptedWriter{
51+
ResponseWriter: c.Writer,
52+
b: bytes.NewBuffer(nil),
53+
}
54+
c.Writer = i
55+
c.Next()
56+
c.Header("X-Test", "overridden")
57+
c.Writer = i.ResponseWriter
58+
})
59+
r.GET("/", func(c *Context) {
60+
c.Header("X-Test", "original")
61+
c.Header("X-Test-2", "present")
62+
c.String(http.StatusOK, "hello world")
63+
})
64+
c.Request = httptest.NewRequest("GET", "/", nil)
65+
r.HandleContext(c)
66+
// Result() has headers frozen when WriteHeaderNow() has been called
67+
// Compared to this time, this is when the response headers will be flushed
68+
// As response is flushed on c.String, the Header cannot be set by the first
69+
// middleware. Assert this
70+
assert.Equal(t, "", w.Result().Header.Get("X-Test"))
71+
assert.Equal(t, "present", w.Result().Header.Get("X-Test-2"))
72+
}

context_appengine.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

context_go17_test.go

-50
This file was deleted.

context_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

debug.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

debug_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

deprecated.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

deprecated_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

errors.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

errors_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

fs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

gin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

ginS/gins.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

gin_integration_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

gin_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

githubapi_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
1+
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/goccy/go-json v0.9.7
99
github.com/json-iterator/go v1.1.12
1010
github.com/mattn/go-isatty v0.0.14
11-
github.com/pelletier/go-toml/v2 v2.0.0-beta.6
11+
github.com/pelletier/go-toml/v2 v2.0.1
1212
github.com/stretchr/testify v1.7.1
1313
github.com/ugorji/go/codec v1.2.7
1414
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110

go.sum

+2-4
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OH
3636
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
3737
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
3838
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
39-
github.com/pelletier/go-toml/v2 v2.0.0-beta.6 h1:JFNqj2afbbhCqTiyN16D7Tudc/aaDzE2FBDk+VlBQnE=
40-
github.com/pelletier/go-toml/v2 v2.0.0-beta.6/go.mod h1:ke6xncR3W76Ba8xnVxkrZG0js6Rd2BsQEAYrfgJ6eQA=
39+
github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU=
40+
github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
4141
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
4242
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4343
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -48,10 +48,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
4848
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
4949
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
5050
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
51-
github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
5251
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
5352
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
54-
github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=
5553
github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M=
5654
github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
5755
github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=

internal/json/go_json.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Bo-Yi Wu. All rights reserved.
1+
// Copyright 2017 Bo-Yi Wu. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

internal/json/json.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Bo-Yi Wu. All rights reserved.
1+
// Copyright 2017 Bo-Yi Wu. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

internal/json/jsoniter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Bo-Yi Wu. All rights reserved.
1+
// Copyright 2017 Bo-Yi Wu. All rights reserved.
22
// Use of this source code is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

0 commit comments

Comments
 (0)