jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Reschke (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-4146) json extension is removed by AbstractWebdavServlet on COPY request
Date Fri, 16 Jun 2017 12:51:00 GMT

    [ https://issues.apache.org/jira/browse/JCR-4146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16051848#comment-16051848

Julian Reschke commented on JCR-4146:

So this happens because of the special-handling of JSON suffixes inside the {{JcrRemotingServlet}}:
the {{Destination}} header field is essentially treated the same way as the request URI, thus
".json" is removed before passing the path down to JCR.

It *seems* this could be addressed by switching off the special handling in {{WebdavRequestImpl.getDestinationLocator}},
but this would require extensions of the {{DavResourceLocator}} API.

[~anchela] - do you believe we could try this without breaking something else?

> json extension is removed by AbstractWebdavServlet on COPY request
> ------------------------------------------------------------------
>                 Key: JCR-4146
>                 URL: https://issues.apache.org/jira/browse/JCR-4146
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-webdav
>    Affects Versions: 2.15.3
>            Reporter: Ana Vinatoru
>            Assignee: Julian Reschke
>         Attachments: JCR-4146.diff
> This issue was first observed via crxDE: the user did a copy / paste on a node with the
.json extension (let's say test.json). After saving, the new node was named "Copy of test"
instead of "Copy of test.json".
> I tracked the request to the AbstractWebdavServlet.doCopy method - and this is where
the .json extension seems to be lost.
> The Destination header sent by crxde includes the extension, but the new resource created
in doCopy does not have it.
> The request looked like this:
> {code:java}
> curl -u admin:admin 'http://localhost:4502/crx/server/crx.default/jcr%3aroot/libs/test.json'
-X COPY -H 'Overwrite: T' -H 'Destination: /crx/server/crx.default/jcr%3aroot/libs/Copy%20of%20test.json'
> {code}
> To rule out issues in other layers, I tested with the Jackrabbit 2.14.x standalone.
> I uploaded the test.json file via WebDav, then executed the following curl request:
> {code:java}
> curl -u admin:admin 'http://localhost:9001/server/default/jcr:root/test.json' -X COPY
-H 'Overwrite: T' -H 'Destination: /server/default/jcr:root/copytest.json' -v
> {code}
> The new node was created, but instead of being named "copytest.json", it is called "copytest".

This message was sent by Atlassian JIRA

View raw message