chore: add more content-type headers (#500)

Co-authored-by: rick <LinuxSuRen@users.noreply.github.com>
This commit is contained in:
Rick 2024-06-28 12:21:05 +08:00 committed by GitHub
parent 157253e9c3
commit 896197110f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 3 deletions

View File

@ -17,6 +17,7 @@ env:
jobs:
goreleaser:
runs-on: ubuntu-22.04
if: github.ref != 'refs/heads/master'
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: ./tools/github-actions/setup-deps

View File

@ -2,6 +2,12 @@
value: ""
- key: Content-Type
value: application/json
- key: Content-Type
value: application/json-patch+json
- key: Content-Type
value: application/merge-patch+json
- key: Content-Type
value: application/apply-patch+yaml
- key: Content-Type
value: application/x-www-form-urlencoded
- key: Accept-Language

View File

@ -771,7 +771,7 @@ func (s *server) PopularHeaders(ctx context.Context, in *Empty) (pairs *Pairs, e
Data: []*Pair{},
}
err = yaml.Unmarshal([]byte(popularHeaders), &pairs.Data)
err = yaml.Unmarshal(popularHeaders, &pairs.Data)
return
}
@ -1009,7 +1009,7 @@ func (s *server) getLoaderByStoreName(storeName string) (loader testing.Writer,
}
//go:embed data/headers.yaml
var popularHeaders string
var popularHeaders []byte
func findParentTestCases(testcase *testing.TestCase, suite *testing.TestSuite) (testcases []testing.TestCase) {
reg, matchErr := regexp.Compile(`(.*?\{\{.*\.\w*.*?\}\})`)

View File

@ -599,7 +599,7 @@ func TestPopularHeaders(t *testing.T) {
pairs, err := server.PopularHeaders(ctx, &Empty{})
if assert.NoError(t, err) {
assert.Equal(t, 6, len(pairs.Data))
assert.Equal(t, 9, len(pairs.Data))
}
}