adminfaces / admin-template

JSF responsive admin template based on Bootstrap and AdminLTE
https://adminfaces.github.io/docs/latest/#admin_template
MIT License
209 stars 101 forks source link

AdminFilter: Skip URI scheme during redirect prefix detection. #198

Closed benkard closed 4 years ago

benkard commented 4 years ago

This fixes the case where a redirect to, say, /index.xhtml comes out as http:/index.xhtml instead of the correct URI. This usually happens when the application prefix is empty and its path is /, which matches the first slash after the URI scheme. This patch handles that case by skipping over the URI scheme when looking for the start of the prefix in the request URI.

If the scheme cannot be detected in the request URI, the behavior is unchanged.

Fixes #160.

benkard commented 4 years ago

If you need an example to test it with, it looks like this bug currently affects admin-showcase:

$ curl -D - https://adminfaces-adminfaces.apps.us-east-2.starter.openshift-online.com/
HTTP/1.1 302 Found
Location: https:/index.xhtml
rmpestano commented 4 years ago

Nice catch, thank you @benkard!