I am relying on @Request.Browser.IsMobileDevice
to differentiate the visitors to an ASP .NET MVC website.
I am using 51 Degrees
library. However when browsing some images from mobile devices, I have the error 414 (request-uri too long)
. On the PC, this is not happening, only on the mobile.
The stack is showing PathTooLongException
at :
à System.IO.PathHelper.GetFullPathName()
à System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
à System.IO.Path.GetFullPathInternal(String path)
à System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
à System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
à System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
à System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
à System.Web.InternalSecurityPermissions.PathDiscovery(String path)
à System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)
à System.Web.HttpServerUtility.MapPath(String path)
à FiftyOne.Foundation.Mobile.Detection.Feature.ImageOptimiser.OptimisedImageResponse(HttpContext context)
à FiftyOne.Foundation.Mobile.Detection.DetectorModule.OnPostAuthorizeRequest(Object sender, EventArgs e)
à System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
à System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
It seems FiftyOne
is in this stack. And when I uninstall 51Degrees, it resumes working. However I need 51Degrees to keep IsMobileDevice
compatible with the current devices.
Is there any parameter I am missing ? 51degrees is version .NET 3.1.9.3