Favicon Issue on HTTPS

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
CGrouse
Lieutenant (LT)
Lieutenant (LT)
Posts: 59
Joined: Tue Jun 10, 2008 12:44 pm

Favicon Issue on HTTPS

Post by CGrouse » Mon Jan 19, 2015 4:28 am

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?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Favicon Issue on HTTPS

Post by mazhar » Mon Jan 19, 2015 5:43 am

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.

CGrouse
Lieutenant (LT)
Lieutenant (LT)
Posts: 59
Joined: Tue Jun 10, 2008 12:44 pm

Re: Favicon Issue on HTTPS

Post by CGrouse » Mon Jan 19, 2015 7:12 am

AbleCommerce Gold (build 5731)

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Favicon Issue on HTTPS

Post by mazhar » Mon Jan 19, 2015 7:21 am

[AC8-2517] - null key exception when user agent is null
This was fixed in Gold R8. It was happening due to empty/null user agent.

CGrouse
Lieutenant (LT)
Lieutenant (LT)
Posts: 59
Joined: Tue Jun 10, 2008 12:44 pm

Re: Favicon Issue on HTTPS

Post by CGrouse » Mon Jan 19, 2015 9:11 am

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?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Favicon Issue on HTTPS

Post by mazhar » Tue Jan 20, 2015 12:17 am

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.

CGrouse
Lieutenant (LT)
Lieutenant (LT)
Posts: 59
Joined: Tue Jun 10, 2008 12:44 pm

Re: Favicon Issue on HTTPS

Post by CGrouse » Tue Jan 20, 2015 4:10 am

We have full source code and both front and back ends have customizations.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Favicon Issue on HTTPS

Post by mazhar » Tue Jan 20, 2015 5:48 am

Edit CommerceBuilder.Services.MobileDetection.cs file and locate following line of code

Code: Select all

return _mobileAgents1.IsMatch(userAgent) || _mobileAgents2.IsMatch(userAgent.Substring(0, 4));
and update it like

Code: Select all

return _mobileAgents1.IsMatch(userAgent) || (userAgent.Length > 4 && _mobileAgents2.IsMatch(userAgent.Substring(0, 4)));

Post Reply