Skip to content

Commit

Permalink
Merge pull request #740 from luraproject/yaml-output-encoding
Browse files Browse the repository at this point in the history
Enabling yaml to negotiated encoding
  • Loading branch information
kpacha authored Dec 10, 2024
2 parents f8a0bc2 + 06f90f7 commit ff47bde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions router/gin/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ func getWithFallback(key string, fallback Render) Render {
}

func negotiatedRender(c *gin.Context, response *proxy.Response) {
switch c.NegotiateFormat(gin.MIMEJSON, gin.MIMEPlain, gin.MIMEXML) {
switch c.NegotiateFormat(gin.MIMEJSON, gin.MIMEPlain, gin.MIMEXML, gin.MIMEYAML) {
case gin.MIMEXML:
getWithFallback(XML, jsonRender)(c, response)
case gin.MIMEPlain:
case gin.MIMEPlain, gin.MIMEYAML:
getWithFallback(YAML, jsonRender)(c, response)
default:
getWithFallback(encoding.JSON, jsonRender)(c, response)
Expand Down

0 comments on commit ff47bde

Please sign in to comment.