Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 4 lib/jsonapi/acts_as_resource_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def resource_klass_name

def verify_content_type_header
if ['create', 'create_relationship', 'update_relationship', 'update'].include?(params[:action])
unless request.content_type == JSONAPI::MEDIA_TYPE
fail JSONAPI::Exceptions::UnsupportedMediaTypeError.new(request.content_type)
unless request.media_type == JSONAPI::MEDIA_TYPE
fail JSONAPI::Exceptions::UnsupportedMediaTypeError.new(request.media_type)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions 4 test/helpers/functional_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ module FunctionalHelpers
# end
# end
#
# if @response.content_type
# ct = @response.content_type
# if @response.media_type
# ct = @response.media_type
# elsif methods.include?('assert_response_response')
# ct = assert_response_response
# else
Expand Down
2 changes: 1 addition & 1 deletion 2 test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class ActionDispatch::IntegrationTest
fixtures :all

def assert_jsonapi_response(expected_status, msg = nil)
assert_equal JSONAPI::MEDIA_TYPE, response.content_type
assert_equal JSONAPI::MEDIA_TYPE, response.media_type
if status != expected_status && status >= 400
pp json_response rescue nil
end
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.