Skip to content

Loosen Accept Header for */* #799

@lgebhardt

Description

@lgebhardt

The accept header is not matching ALL_MEDIA_TYPES when it should be. See #700 https://github.com/cerebris/jsonapi-resources/pull/700#issuecomment-239241977

The fix might be as simple as:

            (media_type == JSONAPI::MEDIA_TYPE || media_type.starts_with( ALL_MEDIA_TYPES) )

With a corresponding test:

  def test_accept_header_all_q
    @request.headers['Accept'] = "*/*;q=0.8"

    assert_cacheable_get :index
    assert_response :success
  end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions