urlrewritefilter icon indicating copy to clipboard operation
urlrewritefilter copied to clipboard

redirect url is not absolute

Open GoogleCodeExporter opened this issue 10 years ago • 0 comments

The HTTP protocol requires the Location header in redirect responses to be an 
absolute URL. The urlrewritefilter documentation and examples all show a 
relative URL being used, e.g.

<to type="redirect">/very/new/page.html</to>

And this indeed results in an invalid Location header with only this relative 
URL.

The expected behavior would be: if the configured URL is absolute it should be 
used as-is, but if it it relative then the request's base url should be 
prepended to it. A possible tweak would be that if it begins with a slash it 
would be added to only the schema+domain[+port], but if it does not begin with 
a slash it would be added after schema+domain[+port]+context. But any other 
solution, even optional attribute (so as not to break backwards compatibility), 
should be ok as long as the output Location URL is absolute.

Original issue reported on code.google.com by amichair on 3 Jul 2014 at 12:53

GoogleCodeExporter avatar Jul 05 '15 22:07 GoogleCodeExporter