Merge pull request #44608 from MGatner/problem-json
Mime Support for "problem detail"
This commit is contained in:
commit
97abaa7157
@ -43,7 +43,8 @@
|
||||
|
||||
# https://www.ietf.org/rfc/rfc4627.txt
|
||||
# http://www.json.org/JSONRequest.html
|
||||
Mime::Type.register "application/json", :json, %w( text/x-json application/jsonrequest )
|
||||
# https://www.ietf.org/rfc/rfc7807.txt
|
||||
Mime::Type.register "application/json", :json, %w( text/x-json application/jsonrequest application/problem+json )
|
||||
|
||||
Mime::Type.register "application/pdf", :pdf, [], %w(pdf)
|
||||
Mime::Type.register "application/zip", :zip, [], %w(zip)
|
||||
|
@ -39,6 +39,13 @@ def teardown
|
||||
)
|
||||
end
|
||||
|
||||
test "parses json params for application problem+json" do
|
||||
assert_parses(
|
||||
{ "person" => { "name" => "David" } },
|
||||
"{\"person\": {\"name\": \"David\"}}", "CONTENT_TYPE" => "application/problem+json"
|
||||
)
|
||||
end
|
||||
|
||||
test "does not parse unregistered media types such as application/vnd.api+json" do
|
||||
assert_parses(
|
||||
{},
|
||||
|
Loading…
Reference in New Issue
Block a user