[ 
https://issues.apache.org/jira/browse/SLING-10006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Norman updated SLING-10006:
--------------------------------
    Description: 
The PostResponseWithErrorHandling implementation is hardcoded to an 
HtmlResponse when the ":sendError" parameter is "true".  This breaks the use 
cases where a Json response is expected.  It also breaks the use case where a 
custom PostResponseCreator component needs to do something different without 
changing the error handling behavior.

For example, this request should return a JSON error response instead of HTML:

 
{code:java}
curl -i -H "Accept: application/json" -F:sendError="true" -F:nameHint="test" 
-Ftext="some body text content" http://admin:admin@localhost:8080/content
{code}
 

  was:
The PostResponseWithErrorHandling implementation is hardcoded to an 
HtmlResponse when the ":sendError" parameter is "true".  This breaks the use 
cases where a Json response is expected.  It also breaks the use case where a 
custom PostResponseCreator component needs to do something different without 
changing the error handling behavior.

For example, this request should return a JSON error response instead of HTML:

 
{code:java}
curl -i -H "Accept: application/json" -F:sendError="true" -F:nameHint="test" 
-Ftext="some body text content" http://localhost:8080/content
{code}
 


> Parameter ":sendError" presence should not replace the PostResponse object
> --------------------------------------------------------------------------
>
>                 Key: SLING-10006
>                 URL: https://issues.apache.org/jira/browse/SLING-10006
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Eric Norman
>            Assignee: Eric Norman
>            Priority: Major
>             Fix For: Servlets POST 2.3.38
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The PostResponseWithErrorHandling implementation is hardcoded to an 
> HtmlResponse when the ":sendError" parameter is "true".  This breaks the use 
> cases where a Json response is expected.  It also breaks the use case where a 
> custom PostResponseCreator component needs to do something different without 
> changing the error handling behavior.
> For example, this request should return a JSON error response instead of HTML:
>  
> {code:java}
> curl -i -H "Accept: application/json" -F:sendError="true" -F:nameHint="test" 
> -Ftext="some body text content" http://admin:admin@localhost:8080/content
> {code}
>  



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

Reply via email to