Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-4766

JcrRemotingServlet should use 'application/json' media type for JSON response

    XMLWordPrintableJSON

Details

    Description

      When retrieving a JCR node using JSON binding like the following by appending '.json' to the path, the content-type of the response should have been application/json, instead of the current text/plain;charset=utf-8.

      GET http://localhost:8080/server/default/jcr:root/hello.json

      Reproduction:

      • Create a node (e.g, hello) like the following (excerpt from [1]):
        $ curl --request MKCOL --data @- --user name:pass \
               http://localhost:8080/server/default/jcr:root/hello/ <<END
        <sv:node sv:name="hello" xmlns:sv="http://www.jcp.org/jcr/sv/1.0">
          <sv:property sv:name="message" sv:type="String">
            <sv:value>Hello, World!</sv:value>
          </sv:property>
          <sv:property sv:name="date" sv:type="Date">
            <sv:value>2022-01-15T12:00:00.000Z</sv:value>
          </sv:property>
        </sv:node>
        END
        
      • Retrieve the node by JSON binding:
        $ curl -i --user admin:admin http://localhost:8080/server/default/jcr:root/hello.json
        
      • The Content-Type response header should be "application/json" or one of its compatibles.
        But the actual value is "text/plain;charset=utf-8".

      [1] https://jukkaz.wordpress.com/2009/11/24/jackrabbit-over-http/

      Attachments

        Issue Links

          Activity

            People

              reschke Julian Reschke
              woonsan Woonsan Ko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: