Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 3, 2020

Conversation

benkard
Copy link
Contributor

@benkard benkard commented May 3, 2020

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.

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 adminfaces#160.
@benkard
Copy link
Contributor Author

benkard commented May 3, 2020

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 rmpestano merged commit 52d3819 into adminfaces:master May 3, 2020
@rmpestano
Copy link
Contributor

Nice catch, thank you @benkard!

@rmpestano rmpestano added this to the 1.1.1 milestone May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weird url when I run my app
2 participants