Open I3undy opened 8 years ago
@Piedone commented on Sep 3, 2014:
I'm not sure I'm following. How exactly would you change CombinatorResource..AbsoluteUrl and what is the aim?
rdobson commented on Sep 3, 2014:
AbsoluteUrl is changed to
public Uri AbsoluteUrl
{
get
{
var fullPath = NormalizedFullPath;
if (Uri.IsWellFormedUriString(fullPath, UriKind.Absolute)) return new Uri(fullPath);
return new Uri(_httpContext.Request.ToBaseUri(), RelativeUrl);
}
}
This is in order to make sure the correct port is maintained, this is important when trying to debug under the Azure Emulator as the port should be but when using _httpContent.Request.Url it thinks it is 82 because that is what it is behind the load balancer, without this fix it makes it impossible to debug.
@Piedone commented on Sep 5, 2014:
So you experience this when running the Azure Orchard solution, right?
rdobson commented on Sep 8, 2014 :
Yes that's correct
@Piedone commented on Sep 8, 2014:
I see. For every other scenario this should be equivalent to the current code but I'm not sure about the case when sites are sitting behind a reverse proxy. I'll do some tests.
@Piedone commented on Sep 8, 2014
With your modification from the other issue I mean?:
rdobson commented on Sep 8, 2014:
Not for resources that are hosted in the webrole, without seeing where the cache files are hosted it tries to use uri.PathAndQuery for those which is not correct if the cache file is hosted outside of the webrole the urls become broken, its got nothing to do with ports at that point, the resources hosted on the webrole need to have absolute url's if the cache file is outside of the webrole, not relative ones.
rdobson commented on Sep 8, 2014:
To put it another way if there is a url quite legitimately of /Module/Styles/image.png it will stay as that in the blob cache file which would then be trying to reference http://storageaccount.blob.core.windows.net/Module/Styles/image.png rather than the correct url of http://www.website.com/Module/Styles/image.png.
rdobson created on Sep 3, 2014: https://combinator.codeplex.com/workitem/65
I have created my own extension method that calls the built in Orchard method but instead returns a Uri of the following in
UriExtensions.cs
:Then used this instead of Request.Url in: