tjg184 / urlrewritefilter

Automatically exported from code.google.com/p/urlrewritefilter
Other
0 stars 0 forks source link

redirect url is not absolute #166

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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