mirror of
https://github.com/gin-gonic/gin.git
synced 2026-06-06 03:08:11 +08:00
Compare commits
3 Commits
8612613044
...
fd57313953
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd57313953 | ||
|
|
5f4f964325 | ||
|
|
b9d6964b7e |
2
.github/workflows/gin.yml
vendored
2
.github/workflows/gin.yml
vendored
@ -78,6 +78,6 @@ jobs:
|
||||
run: make test
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v5
|
||||
uses: codecov/codecov-action@v6
|
||||
with:
|
||||
flags: ${{ matrix.os }},go-${{ matrix.go }},${{ matrix.test-tags }}
|
||||
|
||||
4
.github/workflows/trivy-scan.yml
vendored
4
.github/workflows/trivy-scan.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run Trivy vulnerability scanner (source code)
|
||||
uses: aquasecurity/trivy-action@0.35.0
|
||||
uses: aquasecurity/trivy-action@v0.36.0
|
||||
with:
|
||||
scan-type: "fs"
|
||||
scan-ref: "."
|
||||
@ -44,7 +44,7 @@ jobs:
|
||||
sarif_file: "trivy-results.sarif"
|
||||
|
||||
- name: Run Trivy scanner (table output for logs)
|
||||
uses: aquasecurity/trivy-action@0.35.0
|
||||
uses: aquasecurity/trivy-action@v0.36.0
|
||||
if: always()
|
||||
with:
|
||||
scan-type: "fs"
|
||||
|
||||
@ -1477,10 +1477,8 @@ func (c *Context) Value(key any) any {
|
||||
if key == ContextKey {
|
||||
return c
|
||||
}
|
||||
if keyAsString, ok := key.(string); ok {
|
||||
if val, exists := c.Get(keyAsString); exists {
|
||||
return val
|
||||
}
|
||||
if val, exists := c.Get(key); exists {
|
||||
return val
|
||||
}
|
||||
if !c.hasRequestContext() {
|
||||
return nil
|
||||
|
||||
@ -2931,6 +2931,10 @@ func TestContextGolangContext(t *testing.T) {
|
||||
c.Set("foo", "bar")
|
||||
assert.Equal(t, "bar", c.Value("foo"))
|
||||
assert.Nil(t, c.Value(1))
|
||||
|
||||
type contextKey struct{}
|
||||
c.Set(contextKey{}, "value")
|
||||
assert.Equal(t, "value", c.Value(contextKey{}))
|
||||
}
|
||||
|
||||
func TestWebsocketsRequired(t *testing.T) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user