sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anisha Narang (Jira)" <j...@apache.org>
Subject [jira] [Commented] (SLING-8974) Shows a 200 OK for a delete operation even if the node does not exist.
Date Fri, 10 Jan 2020 07:25:00 GMT

    [ https://issues.apache.org/jira/browse/SLING-8974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17012521#comment-17012521
] 

Anisha Narang commented on SLING-8974:
--------------------------------------

[~rombert] that's awesome, thanks. :)

> Shows a 200 OK for a delete operation even if the node does not exist.
> ----------------------------------------------------------------------
>
>                 Key: SLING-8974
>                 URL: https://issues.apache.org/jira/browse/SLING-8974
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>            Reporter: Anisha Narang
>            Priority: Major
>             Fix For: Servlets POST 2.3.38
>
>
> When you try any curl query for a 'delete' operation, it shows a 200 OK even even the
node does not exist.
> curl query:
> {code:java}
> $ curl -F":operation=delete" http://slinghosturl.com/content/invalid_node
> <html>
> <head>
>     <title>Content modified /content/invalid_node</title>
> </head>
>     <body>
>     <h1>Content modified /content/invalid_node</h1>
>     <table>
>         <tbody>
>             <tr>
>                 <td>Status</td>
>                 <td><div id="Status">200</div></td>
>             </tr>
>             <tr>
>                 <td>Message</td>
>                 <td><div id="Message">OK</div></td>
>             </tr>
>             <tr>
>                 <td>Location</td>
>                 <td><a href="/invalid_node" id="Location">/invalid_node</a></td>
>             </tr>
>             <tr>
>                 <td>Parent Location</td>
>                 <td><a href="/content" id="ParentLocation">/content</a></td>
>             </tr>
>             <tr>
>                 <td>Path</td>
>                 <td><div id="Path">/content/invalid_node</div></td>
>             </tr>
>             <tr>
>                 <td>Referer</td>
>                 <td><div id="Referer"></div></td>
>             </tr>
>             <tr>
>                 <td>ChangeLog</td>
>                 <td><div id="ChangeLog">&lt;pre&gt;deleted(&quot;/content/invalid_node&quot;);&lt;br/&gt;&lt;/pre&gt;</div></td>
>             </tr>
>         </tbody>
>     </table>
>     <p><a href="/invalid_node">Modified Resource</a></p>
>     <p><a href="/content">Parent of Modified Resource</a></p>
>     </body>
> {code}
> So, even though this node does not exist, there is a 200 OK response for the same which
is not expected as per the documentation here -> [https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html#content-removal]
> Expected result:
> The response should be 404 not found if the not does not exist.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message