[
https://issues.apache.org/jira/browse/SLING-10006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Norman resolved SLING-10006.
---------------------------------
Resolution: Fixed
Merged PR to fix it at:
https://github.com/apache/sling-org-apache-sling-servlets-post/commit/c820ce9c746f7cd15b2a418255d1face91b60975
> 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: 1h 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 success 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)