Favicon Issue on HTTPS
Favicon Issue on HTTPS
We recently switched the full site to HTTPS and since then, our error log has been filling up with this message:
An error has occured at https://www.firefold.com/favicon.ico
Exception: Index and length must refer to a location within the string. Parameter name: length Stack Trace: at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at CommerceBuilder.Services.MobileDetection.IsMobileDevice(String userAgent) at CommerceBuilder.Services.MobileDetection.GetBrowserCapabilities(HttpRequest request) at System.Web.Configuration.HttpCapabilitiesBase.GetBrowserCapabilities(HttpRequest request) at System.Web.HttpRequest.get_Browser() at System.Web.Security.CookielessHelperClass.UseCookieless(HttpContext context, Boolean doRedirect, HttpCookieMode cookieMode) at System.Web.Security.FormsAuthenticationModule.ExtractTicketFromCookie(HttpContext context, String name, Boolean& cookielessTicket) at System.Web.Security.FormsAuthenticationModule.OnAuthenticate(FormsAuthenticationEventArgs e) at System.Web.Security.FormsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
The favicon appears to be working properly. Any idea what might be causing this?
An error has occured at https://www.firefold.com/favicon.ico
Exception: Index and length must refer to a location within the string. Parameter name: length Stack Trace: at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at CommerceBuilder.Services.MobileDetection.IsMobileDevice(String userAgent) at CommerceBuilder.Services.MobileDetection.GetBrowserCapabilities(HttpRequest request) at System.Web.Configuration.HttpCapabilitiesBase.GetBrowserCapabilities(HttpRequest request) at System.Web.HttpRequest.get_Browser() at System.Web.Security.CookielessHelperClass.UseCookieless(HttpContext context, Boolean doRedirect, HttpCookieMode cookieMode) at System.Web.Security.FormsAuthenticationModule.ExtractTicketFromCookie(HttpContext context, String name, Boolean& cookielessTicket) at System.Web.Security.FormsAuthenticationModule.OnAuthenticate(FormsAuthenticationEventArgs e) at System.Web.Security.FormsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
The favicon appears to be working properly. Any idea what might be causing this?
Re: Favicon Issue on HTTPS
Which version of Gold is this ? There was an issue with Mobile Detection logic similar to this which was fixed a while ago. The issue which was fixed due to empty user agent.
Re: Favicon Issue on HTTPS
AbleCommerce Gold (build 5731)
Re: Favicon Issue on HTTPS
This was fixed in Gold R8. It was happening due to empty/null user agent.[AC8-2517] - null key exception when user agent is null
Re: Favicon Issue on HTTPS
I don't foresee us upgrading anytime soon, as we have quite a bit of customization going on. Is there a fix we can apply?
Re: Favicon Issue on HTTPS
Since you mentioned about customization, do you have back end source code and customized it or they are just front end custom codes? If you are already working against back end codes for customization then I can provide you with instructions to get it fixed in source.
Re: Favicon Issue on HTTPS
We have full source code and both front and back ends have customizations.
Re: Favicon Issue on HTTPS
Edit CommerceBuilder.Services.MobileDetection.cs file and locate following line of code
and update it like
Code: Select all
return _mobileAgents1.IsMatch(userAgent) || _mobileAgents2.IsMatch(userAgent.Substring(0, 4));
Code: Select all
return _mobileAgents1.IsMatch(userAgent) || (userAgent.Length > 4 && _mobileAgents2.IsMatch(userAgent.Substring(0, 4)));