sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <>
Subject [jira] [Commented] (SLING-3374) Overlay sendRedirect to get relative Location header
Date Wed, 05 Feb 2014 08:54:10 GMT


Felix Meschberger commented on SLING-3374:

Technically we can (and in an internal discussion I may actually have stipulated that we)
implement the sendRedirect method in Sling to return a relative path.

There are two problems, though with respect to specification compliance:

# The Servlet API spec requires the [sendRedirect|]
method to set an absolute URL on the Location header.
# The current HTTP/1.1 spec (RFC 2616) mandates the [Location|]
header to be an absolute URI (which is considered a bug to be fixed in the upcoming HTTP spec:

Given that the HTTP spec is being updated and most if not all modern browsers today support
relative URI Location headers, it would be conceivable to wrap the sendRedirect method to
always use a relative URL instead of forcing an absolute one.

But then: what would be the benefit of having a relative URL as opposed to an absolute URL
? Could it be that the HttpServletRequest.getServerName and HttpServletRequest.getServerPort
yield wrong (or unexpected) values behind a caching proxy ?

> Overlay sendRedirect to get relative Location header
> ----------------------------------------------------
>                 Key: SLING-3374
>                 URL:
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Laurie byrum
> Recently, Location headers returned from redirects started being absolute instead of
> We should try to decorate this in sling.
> Can we replace the sendRedirect with a set-header set-status combination
> in sling?

This message was sent by Atlassian JIRA

View raw message