File tree 5 files changed +18
-26
lines changed
5 files changed +18
-26
lines changed Original file line number Diff line number Diff line change @@ -2,18 +2,16 @@ name: Go
2
2
on : [push, pull_request]
3
3
4
4
jobs :
5
-
6
5
test :
7
6
name : Test
8
7
runs-on : ${{ matrix.os }}
9
8
10
9
strategy :
11
10
matrix :
12
11
os : [ubuntu-latest, macOS-latest, windows-latest]
13
- go : ['1.22.x', '1.23.x' ]
12
+ go : ["1.23.x", "1.24.x" ]
14
13
15
14
steps :
16
-
17
15
- name : Check out code into the Go module directory
18
16
uses : actions/checkout@v4
19
17
30
28
run : go test -race -v -coverprofile='coverage.txt' -covermode=atomic ./...
31
29
32
30
- name : Upload Coverage report
33
- uses : codecov/codecov-action@v4
31
+ uses : codecov/codecov-action@v5
34
32
with :
35
33
token : ${{secrets.CODECOV_TOKEN}}
36
- file : ./coverage.txt
34
+ files : ./coverage.txt
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ module github.com/issue9/mux/v9
3
3
require (
4
4
github.com/issue9/assert/v4 v4.3.1
5
5
github.com/issue9/errwrap v0.3.2
6
- github.com/issue9/source v0.11.7
6
+ github.com/issue9/source v0.12.5
7
7
)
8
8
9
- require golang.org/x/mod v0.22 .0 // indirect
9
+ require golang.org/x/mod v0.24 .0 // indirect
10
10
11
- go 1.22 .0
11
+ go 1.23 .0
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ github.com/issue9/assert/v4 v4.3.1 h1:dHYODk1yV7j/1baIB6K6UggI4r1Hfuljqic7PaDbwL
2
2
github.com/issue9/assert/v4 v4.3.1 /go.mod h1:v7qDRXi7AsaZZNh8eAK2rkLJg5/clztqQGA1DRv9Lv4 =
3
3
github.com/issue9/errwrap v0.3.2 h1:7KEme9Pfe75M+sIMcPCn/DV90wjnOcRbO4DXVAHj3Fw =
4
4
github.com/issue9/errwrap v0.3.2 /go.mod h1:KcCLuUGiffjooLCUjL89r1cyO8/HT/VRcQrneO53N3A =
5
- github.com/issue9/source v0.11.7 h1:wyZv2MExD1kem7FGxIy6/iSgDHqNpLox6dAZfP7VzKM =
6
- github.com/issue9/source v0.11.7 /go.mod h1:cmLmHZdgj+ONnGNdnJp++94VKXTszNAD99hAYOC22bU =
7
- golang.org/x/mod v0.22 .0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4 =
8
- golang.org/x/mod v0.22 .0 /go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY =
5
+ github.com/issue9/source v0.12.5 h1:yfp7gZLMGArbpYgn3wEJ6WAXvx2dCknEXUec/+e3WyE =
6
+ github.com/issue9/source v0.12.5 /go.mod h1:5nOhQUwAwEjFVeFkY0QJgSEMsmwHxNugO9O4RhfLNH4 =
7
+ golang.org/x/mod v0.24 .0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU =
8
+ golang.org/x/mod v0.24 .0 /go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww =
Original file line number Diff line number Diff line change 1
- // SPDX-FileCopyrightText: 2014-2024 caixw
1
+ // SPDX-FileCopyrightText: 2014-2025 caixw
2
2
//
3
3
// SPDX-License-Identifier: MIT
4
4
@@ -221,20 +221,14 @@ func (o *options) sanitize() error {
221
221
}
222
222
223
223
func (c * cors ) sanitize () error {
224
- for _ , o := range c .Origins {
225
- if o == "*" {
226
- c .anyOrigins = true
227
- break
228
- }
224
+ if slices .Contains (c .Origins , "*" ) {
225
+ c .anyOrigins = true
229
226
}
230
227
c .deny = len (c .Origins ) == 0
231
228
232
- for _ , h := range c .AllowHeaders {
233
- if h == "*" {
234
- c .allowHeadersString = "*"
235
- c .anyHeaders = true
236
- break
237
- }
229
+ if slices .Contains (c .AllowHeaders , "*" ) {
230
+ c .allowHeadersString = "*," + header .Authorization // Firefox 中 * 并不包含 Authorization 报头。
231
+ c .anyHeaders = true
238
232
}
239
233
if c .allowHeadersString == "" && len (c .AllowHeaders ) > 0 {
240
234
c .allowHeadersString = strings .Join (c .AllowHeaders , "," )
Original file line number Diff line number Diff line change 1
- // SPDX-FileCopyrightText: 2014-2024 caixw
1
+ // SPDX-FileCopyrightText: 2014-2025 caixw
2
2
//
3
3
// SPDX-License-Identifier: MIT
4
4
@@ -149,7 +149,7 @@ func TestCORS_sanitize(t *testing.T) {
149
149
}
150
150
a .NotError (c .sanitize ())
151
151
a .True (c .anyHeaders ).
152
- Equal (c .allowHeadersString , "*" ).
152
+ Equal (c .allowHeadersString , "*," + header . Authorization ).
153
153
Equal (c .exposedHeadersString , "h1,h2" )
154
154
}
155
155
You can’t perform that action at this time.
0 commit comments