Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-21376

[REST] Any accept header is returning data

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: High High
    • QA tracked issues
    • 5.2-dev, 5.2
    • Platform > REST API v2
    • None
    • Server OS: CentOS 6.4
      PHP: 5.3.3
      Database: MySQL 5.1.69
      Browser: Firefox 20.0

    Description

      If the accept header of the request doesn't belong to the resource, it will return the data anyway.
      I've seen no mention to what should be the expected behaviour when the wrong parameter is passed to accept header.
      ( https://github.com/ezsystems/ezpublish-kernel/blob/master/doc/specifications/rest/REST-API-V2.rst )

      For example: Get content type (article)

      Header should be (xml or json):

      GET /api/ezp/v2/content/types/16
      Accept: application/vnd.ez.api.ContentType+xml
      Authorization: Basic YWRtaW46cHVibGlzaA==
      

      However it will work if it is:

      GET /api/ezp/v2/content/types/16
      Accept: non-existing-parameter
      Authorization: Basic YWRtaW46cHVibGlzaA==
      

      Or even:

      GET /api/ezp/v2/content/types/16
      Accept:
      Authorization: Basic YWRtaW46cHVibGlzaA==
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            marcos.loureiro-obsolete@ez.no Marcos Loureiro (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: