Foros de discusión

How to turn off: Liferay-generated URLS in HTML are coded in Hex Decimal

Steven Lorscheid, modificado hace 9 años.

How to turn off: Liferay-generated URLS in HTML are coded in Hex Decimal

New Member Mensajes: 2 Fecha de incorporación: 14/11/13 Mensajes recientes
Hi everyone,
Im using Liferay 6.2 EntrepriseEdition ServicePack 9.
I am confronted with the following problem:
URLs which are part of the returned HTML (for example references to styles ) are being coded by Liferay in Hex Decimal Code ( see http://character-code.com/ ).
Our Reverse proxy, who is responsible for URL-Rewriting searchs for something which is not Hex Decimal coded, and isn't able to find a match.
That causes him to think, that the URL is a relative one, and he tries to complete the relative URL by sticking his URL in front of the URL found in the HTML.

Finally the style cannot be loaded, because the URL is completly messed up.

Example:

1) URL which is used to call the Reverse Proxy Server: https://yyy.yy.yy/portal/[...]
2) Reverse Proxy Server replaces to https://zzz.zz.zz/portal/[...] and calls Liferay with that URL.
3) Liferay responds with an HTML-File which includes a reference to a Style-sheet: https://zzz.zz.zz/portal&#x2f[...];
4) Reverse Proxy Server wants to do URL-Rewriting and searchs in the HTML for pattern: "https://zzz.zz.zz/portal/" .
5) Reverse Proxy Server has no pattern match.
6) Reverse Proxy Server sticks "https://yyy.yy.yy/portal/" in front of https://zzz.zz.zz/portal&#x2f[...];
7) "https://yyy.yy.yy/portal/https://zzz.zz.zz/portal&#x2f[...]; is being returned.
8) URL is useless.

Question:
1) Is it possible to configure Liferay not to code URLS in Hex Decimal Code.?
2) Is it possible to configure Liferay to only return relativ URLs)

Thanks for help,
Steven
thumbnail
David H Nebinger, modificado hace 9 años.

RE: How to turn off: Liferay-generated URLS in HTML are coded in Hex Decima

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
Steven Lorscheid:
1) Is it possible to configure Liferay not to code URLS in Hex Decimal Code.?


No.

2) Is it possible to configure Liferay to only return relativ URLs)


No.

Seriously, Liferay's URL generation has gone through many rounds of tweaking and changing over the years. The encoding is done for perhaps not so obvious reasons but they need to be done.

Have you asked in the forums for your reverse proxy server if it can be made smart enough to handle encoded urls?
Steven Lorscheid, modificado hace 8 años.

RE: How to turn off: Liferay-generated URLS in HTML are coded in Hex Decima

New Member Mensajes: 2 Fecha de incorporación: 14/11/13 Mensajes recientes
Hi David,

meanwhile we tried to contact the provider of our proxyserver. See what they answered us 2 days ago:

Extraweb only support percentage encoded urls that is of '%2f' type.
Urls encoded with '#', '&' and Decimal value are treated as normal strings. Thus when encountered with a 'href' tag it is considered a relative url and gets translated. The appliance is behaving correctly and as expected
.

So, is it possible to configure Liferay that it creates URLs, which are encoded in a different way, for example of '%2f' type, like mentioned above?

Regards,
Steven
thumbnail
David H Nebinger, modificado hace 8 años.

RE: How to turn off: Liferay-generated URLS in HTML are coded in Hex Decima

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
I think the hex encoding is done to encapsulate issues with i18n URLs. I'm not sure that it can be changed to handle %2f format as it can't support UTF-8.
Cyber Katze, modificado hace 8 años.

RE: How to turn off: Liferay-generated URLS in HTML are coded in Hex Decima

thumbnail
Olaf Kock, modificado hace 8 años.

RE: How to turn off: Liferay-generated URLS in HTML are coded in Hex Decima

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
For moving from http to https you can make Liferay generate HTTPS links only. Just make tomcat (or whatever appserver you use) aware that the connection is coming in through HTTPS. This information will be checked by Liferay and Liferay will only generate https URLs for connections that come in through https. (AJP does this out of the box. For HTTP-proxying you might have to tweak tomcat's connectors and use one that you declare as secure in tomcat's configuration)

And you can tweak Liferay's settings more and just make Liferay unconditionally generate https URLs (search portal.properties for https, I don't have the reference at hand)
Cyber Katze, modificado hace 8 años.

RE: How to turn off: Liferay-generated URLS in HTML are coded in Hex Decima

thumbnail
Olaf Kock, modificado hace 8 años.

RE: How to turn off: Liferay-generated URLS in HTML are coded in Hex Decima

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
You can test if tomcat is aware of the https nature of a connection by calling the PortletRequest's method isSecure or even on the original ServletRequest