[
https://issues.apache.org/jira/browse/SLING-3201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Felix Meschberger updated SLING-3201:
-------------------------------------
Component/s: (was: General)
Servlets
Affects Version/s: Servlets Post 2.3.2
Fix Version/s: Servlets Post 2.3.4
Assignee: Felix Meschberger
> Redirect after post not possible
> --------------------------------
>
> Key: SLING-3201
> URL: https://issues.apache.org/jira/browse/SLING-3201
> Project: Sling
> Issue Type: Bug
> Components: Servlets
> Affects Versions: Servlets Post 2.3.2
> Reporter: Laurie byrum
> Assignee: Felix Meschberger
> Fix For: Servlets Post 2.3.4
>
>
> We are using the default post servlet and have PostOperation implementations
> that run some of our code and set up the response. In certain cases, we'd
> like to redirect (via a 302 response + Location header). When we do this, the
> 302 is returned, but the Location isn't set because of code here:
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.sling/org.apache.sling.servlets.post/2.3.0/org/apache/sling/servlets/post/AbstractPostResponse.java#320
> I talked to Felix Meschberger about this. His response was:
> Looking at the code and the HTTP spec, I would think that the iff statement
> is incomplete and should not only encompass the 201/CREATED code but also the
> 3xx redirect codes, something like:
> if (statusCode == HttpServletResponse.SC_CREATED || statusCode / 100 == 3) {
> response.setHeader("Location", getLocation());
> }
> So, I would think this is a bug (or oversight) in the AbstractPostResponse.
> Do you mind reporting a Sling issue ?
--
This message was sent by Atlassian JIRA
(v6.1#6144)