This question is locked. New answers and comments are not allowed.
Hi,
With the latest version of the Telerik MVC (2010.3.1110), when using shared web assets with .Combined(true), the WebAssetGroup.ContentType is null when running in the WebAssetHttpHandler.ProcessRequest(HttpContextBase context).
This results in RebaseImagePathContentFilter.AppliesTo(string contentType) returning false in the WebAssetGroupReader.Read(WebAssetGroup group) method, thus not applying the filter for images in css-files.
Is there a quick fix, maybe? I hope you can reproduce the bug.
Regards,
Mario I.
With the latest version of the Telerik MVC (2010.3.1110), when using shared web assets with .Combined(true), the WebAssetGroup.ContentType is null when running in the WebAssetHttpHandler.ProcessRequest(HttpContextBase context).
public override void ProcessRequest(HttpContextBase context){ string id = context.Request.QueryString[IdParameterName]; if (!string.IsNullOrEmpty(id)) { WebAssetGroup group = SharedWebAssets.FindScriptGroup(id) ?? SharedWebAssets.FindStyleSheetGroup(id) ?? new WebAssetGroupSerializer().Deserialize(id); if (group != null) { HttpResponseBase response = context.Response; // Set the content type response.ContentType = group.ContentType;// This is null.
string content = reader.Read(group); if (!string.IsNullOrEmpty(content)) { // Compress if (group.Compress && !context.IsMono()) { httpResponseCompressor.Compress(context); } // Write using (StreamWriter sw = new StreamWriter((response.OutputStream))) { sw.Write(content); } // Cache if (!context.IsDebuggingEnabled) { httpResponseCacher.Cache(context, TimeSpan.FromDays(group.CacheDurationInDays)); } } } }}This results in RebaseImagePathContentFilter.AppliesTo(string contentType) returning false in the WebAssetGroupReader.Read(WebAssetGroup group) method, thus not applying the filter for images in css-files.
public string Read(WebAssetGroup group){ var appliesTo = filter.AppliesTo(group.ContentType);// This returns false (ContentType is null)
var result = new StringBuilder(); foreach (var asset in group.Items) { var path = locator.Locate(asset.Source, group.Version); var text = provider.ReadAllText(path); if (appliesTo)// Does not apply if ContentType is null. No images work for css. { var basePath = provider.GetDirectory(path); text = filter.Filter(basePath, text); } result.Append(text); } return result.ToString();}Is there a quick fix, maybe? I hope you can reproduce the bug.
Regards,
Mario I.