You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quality arguments to Accept header should default to 1.0 (#2366)
* Quality arguments to Accept header should default to 1.0
* space
* Fix spec that results in XML
* sort only once
* Simplify
* Ensure empty and invalid quality values also parse correctly, specs
* Update CHANGELOG.md
* Comments for readme and changelog
*[#2366](https://github.com/ruby-grape/grape/pull/2366): Default quality to 1.0 in the `Accept` header when omitted - [@hiddewie](https://github.com/hiddewie).
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -596,6 +596,10 @@ When an invalid `Accept` header is supplied, a `406 Not Acceptable` error is ret
596
596
option is set to `false`. Otherwise a `404 Not Found` error is returned by Rack if no other route
597
597
matches.
598
598
599
+
Grape will evaluate the relative quality preference included in Accept headers and default to a quality of 1.0 when omitted. In the following example a Grape API that supports XML and JSON in that order will return JSON:
0 commit comments