You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (Jira)" <ji...@apache.org> on 2022/06/12 14:15:00 UTC
[jira] [Updated] (JCR-4766) JcrRemotingServlet should use 'application/json' media type for JSON response
[ https://issues.apache.org/jira/browse/JCR-4766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Reschke updated JCR-4766:
--------------------------------
Fix Version/s: 2.20.6
> JcrRemotingServlet should use 'application/json' media type for JSON response
> -----------------------------------------------------------------------------
>
> Key: JCR-4766
> URL: https://issues.apache.org/jira/browse/JCR-4766
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-jcr-server
> Affects Versions: 2.21.10
> Reporter: Woonsan Ko
> Assignee: Julian Reschke
> Priority: Minor
> Labels: candidate_jcr_2_20
> Fix For: 2.22, 2.21.11, 2.20.6
>
>
> 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]):
> {code}
> $ 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
> {code}
> - Retrieve the node by JSON binding:
> {code}
> $ curl -i --user admin:admin http://localhost:8080/server/default/jcr:root/hello.json
> {code}
> - 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/
--
This message was sent by Atlassian Jira
(v8.20.7#820007)