Wir ASP.NET auf einen benutzerdefinierten REST Handler, der so konfiguriert ist, um alle eingehenden Anforderungen verarbeiten:ASP.NET URL Validierung
<add path="*" verb="*" type="REST.RESTProtocolHandler"/>
Es ist jedoch ein Pipezeichen Geben, richtig codiert oder gar nicht , löst einen Validierungsfehler aus, der scheinbar aus ASP.NET stammt.
Zugriff http://localhost:8080/%7c
oder http://localhost:8080/|
ergibt diesen Fehler:
[ArgumentException: Illegal characters in path.] System.IO.Path.CheckInvalidPathChars(String path) +7489125 System.IO.Path.Combine(String path1, String path2) +40 System.Web.Configuration.UserMapPath.GetPhysicalPathForPath(String path, VirtualDirectoryMapping mapping) +114 System.Web.Configuration.UserMapPath.GetPathConfigFilename(String siteID, VirtualPath path, String& directory, String& baseName) +72 System.Web.Configuration.UserMapPath.MapPath(String siteID, VirtualPath path) +30 System.Web.Configuration.UserMapPath.MapPath(String siteID, String path) +31 System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +297 System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath, Boolean permitNull) +51 System.Web.CachedPathData.GetConfigPathData(String configPath) +341 System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +110 System.Web.HttpContext.GetFilePathData() +36 System.Web.HttpContext.GetConfigurationPathData() +26 System.Web.Configuration.RuntimeConfig.GetConfig(HttpContext context) +43 System.Web.Configuration.CustomErrorsSection.GetSettings(HttpContext context, Boolean canThrow) +41 System.Web.HttpResponse.ReportRuntimeError(Exception e, Boolean canThrow, Boolean localExecute) +101 System.Web.HttpRuntime.FinishRequest(HttpWorkerRequest wr, HttpContext context, Exception e) +383
Kein Userland-Code ausgeführt wird. Ist das irgendwo eine Konfigurationsoption? Reproduziert auf IIS 7 & VS Studio 2008 devel Server.
Stack Overflow scheint diesen Fehler zu beheben OK, es sieht so aus, als ob eine dynamisch generierte 404 MVC-Seite für https://stackoverflow.com/%7c gerendert wird.
Irgendwelche Ideen?
Wenn Sie sich http://StackOverflow.com/%7c ansehen, werden Sie sehen, dass Sie eine gerenderte Seite erhalten (Ihr Benutzername ist ein Hinweis), also muss es eine Möglichkeit geben, dies zu tun. – bh213