Skip to content

Commit

Permalink
Extend regex to support optional charset on the media types
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk Rudolph committed Feb 10, 2020
1 parent 55a1793 commit 6b00a53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apisprout.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ var (
)

var (
marshalJSONMatcher = regexp.MustCompile(`^application/(vnd\..+\+)?json$`)
marshalYAMLMatcher = regexp.MustCompile(`^(application|text)/(x-|vnd\..+\+)?yaml$`)
marshalJSONMatcher = regexp.MustCompile(`^application/(vnd\..+\+)?json(; ?charset=.+)?$`)
marshalYAMLMatcher = regexp.MustCompile(`^(application|text)/(x-|vnd\..+\+)?yaml(; ?charset=.+)?$`)
)

type RefreshableRouter struct {
Expand Down

0 comments on commit 6b00a53

Please sign in to comment.