[SEO Utils] GetScreenUrl action returns HTTP instead of HTTPS in some cases (bug fix)

[SEO Utils] GetScreenUrl action returns HTTP instead of HTTPS in some cases (bug fix)

  
Forge Component
(3)
Published on 2013-04-08 by Davide Marquês
3 votes
Published on 2013-04-08 by Davide Marquês

When using the GetScreenUrl actions we discovered an issue that it sometimes generates URLs that do not contain https preventing, for instance, pop-up pages to be shown in our secure app environment. 

The following line of code to generate the URL in the extension contains an small error:

ssURL = ((((IWebScreen)Page).isSecure == RuntimePlatformUtils.RequestIsSecure(request) && RuntimePlatformUtils.RequestIsSecure(request)) ? "http://" :
                (RuntimePlatformUtils.RequestIsSecure(request) ? "https://" : "http://")) +
                (EmailScreenUtils.SafeGetEmailHost(Page as IEmailScreen) ?? request.Headers["OS-Host"] ?? request.Url.Host) +
                request.Headers["OS-Host-Suffix"] +
                RuntimePlatformUtils.GetEspacePrettyNamePath(sseSpaceName, heContext);

This should be:

ssURL = ((((IWebScreen)Page).isSecure == RuntimePlatformUtils.RequestIsSecure(request) && RuntimePlatformUtils.RequestIsSecure(request)) ? "https://" :
                (RuntimePlatformUtils.RequestIsSecure(request) ? "https://" : "http://")) +
                (EmailScreenUtils.SafeGetEmailHost(Page as IEmailScreen) ?? request.Headers["OS-Host"] ?? request.Url.Host) +
                request.Headers["OS-Host-Suffix"] +
                RuntimePlatformUtils.GetEspacePrettyNamePath(sseSpaceName, heContext);

After implementing this fix our issues were resolved.

Maybe this fix can be implemented in a new release of this component?



Hi Peter,

Thanks for reaching out... it's been a while since I looked at this component so I'll need to read through and test it again.

What you did write sounds very plausible indeed, and my code looks decidedly suspicious... but I need to be careful before changing it :-)

Regards,


Miguel