cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BURGHARD Éric <eric.burgh...@systheo.com>
Subject Re: Protocol switch in portals (was Re: furious anger: portal broken)
Date Wed, 21 Sep 2005 12:04:25 GMT
Bertrand Delacretaz wrote:

> Le 20 sept. 05, à 10:57, Carsten Ziegeler a écrit :
>> ...The LinkService accepts a boolean argument indicating if you want a
>> secure link. If this is set to true then the service switches to https.
>> As I said yesterday, we could create relative links if the procotol is
>> not changed, but there are cases where we need absolute links...
> 
> There are other use-cases for absolutizing links: in one of my projects
> we're sending a newsletter as an HTML email (only to users who want it
> ;-) and in such a case you need to absolutize all links in the
> generated email so that the mail client gets correct URLs. The brute
> force way is to configure the base absolute URL somewhere, but a
> general mechanism might be useful.
> 

Yes, this is exactly what i'm trying to do, and found that thread while
looking for a way to solve this problem (as i found bertrand's blog about
MailTransformer :-).

If i understand correctly, the request.getServerName() is not useable for
absolutisation since it names the server in his local environnement
(doesn't follow virtual host name for example). I don't really see the use
of such method in the request object where you are more interrested by the
request than the local network environnment.

Perhaps the solution is just to replace the request.getServerName() and
getServerPort() by the value retrieved from the 'Host' request header
attribute which contain normally both.

Regards.


Mime
View raw message