Design and CSS styles
Version 7.x > Design and CSS styles > GetResource adds the domain to urls View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
emanuele.firmani-aduno-gruppe - 12/20/2012 2:49:59 AM
   
GetResource adds the domain to urls
I'm using Kentico v7.0.4696.
I have several CSSes that I reference as /CMSPages/GetResource.ashx?stylesheetname=name.
The problem is that it's adding the domain to the picture urls, i.e. the css line
background:url(/media/images/backgrounds/pic.png) repeat-y;

is transformed into
background:url(http://www.domain.com/media/images/backgrounds/pic.png) repeat-y;

When the page is rendered via htts, such line still uses the http url, leading to a certificate message to the user.

How can I solve it?
Thanks
Regards
Emanuele Firmani

User avatar
Kentico Support
Kentico Support
kentico_janh - 12/27/2012 1:56:06 AM
   
RE:GetResource adds the domain to urls
Hello,

You can comment following line out from the \App_Code\CMSPages\GetResource.ashx.cs file (line 1237):

// result.Data = HTMLHelper.ResolveCSSClientUrls(result.Data, URLHelper.GetAbsoluteUrl("~/CMSPages/GetResource.ashx"));


Best regards,
Jan Hermann

User avatar
Certified Developer v7
Certified  Developer v7
emanuele.firmani-aduno-gruppe - 12/31/2012 7:14:11 AM
   
RE:GetResource adds the domain to urls
It worked, but I think this is a bug: I found out that the the request ~/CMSPages/GetResource.ashx invokes my custom CMSLoaderAttribute that set the URLHelper.IsSSL flag, but the file GetResource.ashx.cs doesn't take in consideration such flag.
Having a reverse proxy in front of my web servers, all the requests arrive to Kentico as http (https is removed), and I think the mentioned file should consider the custom flag to define whether a request was served via ssl or not.

Hope I was clear.
Many thanks for your support
Regards
Emanuele Firmani

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/8/2013 3:48:25 AM
   
RE:GetResource adds the domain to urls
Hello,

I have consulted it with our development department and it should return appropriate protocol. We'll take a look at it and fix it.

Best regards,
Jan Hermann

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/11/2013 1:42:52 AM
   
RE:GetResource adds the domain to urls
Hello,

Please apply the latest hotfix (7.0.15) to fix this issue.

Best regards,
Jan Hermann