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

value href-attribute of base-tag not rewritten #252

Open
groie opened this issue Oct 6, 2017 · 1 comment
Open

value href-attribute of base-tag not rewritten #252

groie opened this issue Oct 6, 2017 · 1 comment
Labels

Comments

@groie
Copy link

groie commented Oct 6, 2017

Angular applications use a base-tag inside the head-tag. The base tag has an href attribute which is the intended context path of the application. This value is not rewritten causing the application not to work.

Is there a way to add another processor to ocpsoft-rewrite that it would also rewrite this attribute?

Angular documentation of base-Tag: https://angular.io/guide/router

@chkal
Copy link
Member

chkal commented Oct 7, 2017

Rewrite can only rewrite URLs, if they are passed though HttpServletResponse.encodeURL(). Typically all URLs rendered to the page are encoded this way to preserve JSESSIONID if used. So if you simple put a string literal into your page, it won't be rewritten.

You could either encode the URL using HttpServletResponse.encodeURL() yourself, or you could the Transformer API to modify the HTML by doing some kind of search + replace.

@chkal chkal added the support label Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants