shinesolutions/ruby_aem

Allow 201 as success scenario for setting user password

Closed this issue · 1 comments

Following certain events (in this case, after crxde is disabled), change password operation responds with 201 as a success indicator.

Wrapped exception:
Unexpected response
status code: 201
headers: {"Date"=>"Tue, 11 Jul 2017 01:21:14 GMT", "X-Content-Type-Options"=>"nosniff", "Set-Cookie"=>"cq-authoring-mode=CLASSIC;Path=/;Expires=Tue, 18-Jul-2017 01:21:14 GMT", "Expires"=>"Thu, 01 Jan 1970 00:00:00 GMT", "Location"=>"/crx/explorer/ui/setpassword.jsp", "Content-Type"=>"text/html; charset=UTF-8", "Transfer-Encoding"=>"chunked"}
body: <html>
<head>
    <title>Content created /crx/explorer/ui/setpassword.jsp</title>
</head>
    <body>
    <h1>Content created /crx/explorer/ui/setpassword.jsp</h1>
    <table>
        <tbody>
            <tr>
                <td>Status</td>
                <td><div id="Status">201</div></td>
            </tr>
            <tr>
                <td>Message</td>
                <td><div id="Message">Created</div></td>
            </tr>
            <tr>
                <td>Location</td>
                <td><a href="/crx/explorer/ui/setpassword.jsp" id="Location">/crx/explorer/ui/setpassword.jsp</a></td>
            </tr>
            <tr>
                <td>Parent Location</td>
                <td><a href="/crx/explorer/ui" id="ParentLocation">/crx/explorer/ui</a></td>
            </tr>
            <tr>
                <td>Path</td>
                <td><div id="Path">/crx/explorer/ui/setpassword.jsp</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;created(&quot;/crx&quot;);&lt;br/&gt;created(&quot;/crx/explorer&quot;);&lt;br/&gt;created(&quot;/crx/explorer/ui&quot;);&lt;br/&gt;created(&quot;/crx/explorer/ui/setpassword.jsp&quot;);&lt;br/&gt;modified(&quot;/crx/explorer/ui/setpassword.jsp/old&quot;);&lt;br/&gt;modified(&quot;/crx/explorer/ui/setpassword.jsp/plain&quot;);&lt;br/&gt;modified(&quot;/crx/explorer/ui/setpassword.jsp/verify&quot;);&lt;br/&gt;&lt;/pre&gt;</div></td>
            </tr>
        </tbody>
    </table>
    <p><a href="/crx/explorer/ui/setpassword.jsp">Modified Resource</a></p>
    <p><a href="/crx/explorer/ui">Parent of Modified Resource</a></p>
    </body>
</html>

After further testing with various repository states, we found out that 201 shouldn't be considered a success scenario.

The problem originated from crx-explorer bundle being disabled, which led AEM to create a default node at /crx/explorer/ui/setpassword.jsp when a request is sent to /crx/explorer/ui/setpassword.jsp , and this node does not actually contain any logic for setting user password.

Change ec30d4e will be reverted.