我依靠@Request.Browser.IsMobileDevice
区分 ASP .NET MVC 网站的访问者。
我正在使用51 Degrees
图书馆。但是,当从移动设备浏览某些图像时,出现错误414 (request-uri too long)
。在 PC 上,这不会发生,只有在移动设备上才会发生。
堆栈显示PathTooLongException
在:
à 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)
似乎FiftyOne
在这个堆栈中。当我卸载 51Degrees 时,它会恢复工作。但是我需要 51Degrees 才能与当前设备保持IsMobileDevice
兼容。
有没有我遗漏的参数?51度是版本.NET 3.1.9.3