Skip to content

Commit

Permalink
fix(server/config): 解决配置文件未正确初始化 Codec 的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Oct 22, 2024
1 parent 32ae708 commit 70fe466
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/config/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,6 @@ func (conf *configOf[T]) sanitizeMimetypes(c *web.Codec) *web.FieldError {
c.AddMimetype(item.Type, m.marshal, m.unmarshal, item.Problem)
}

conf.codec = c
return nil
}
2 changes: 1 addition & 1 deletion server/config/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestConfigOf_sanitizeMimetypes(t *testing.T) {
{Type: "xml", Target: "xml"},
},
}
a.NotError(conf.buildCodec())
a.NotError(conf.buildCodec()).NotNil(conf.codec)

conf = &configOf[empty]{
Mimetypes: []*mimetypeConfig{
Expand Down

0 comments on commit 70fe466

Please sign in to comment.