Skip to content
This repository was archived by the owner on Nov 6, 2018. It is now read-only.
This repository was archived by the owner on Nov 6, 2018. It is now read-only.

NotSupportedException for URLs with special characters #137

Closed
@Tratcher

Description

@Tratcher

Moved from http://katanaproject.codeplex.com/workitem/430

The static file middleware raises an exception when the input URL contains a character that is valid for HTTP but not authorized on a local path. Example: '/test:character' (note the colon).

      System.NotSupportedException: The given path's format is not supported.
         at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
         at Microsoft.AspNet.FileProviders.PhysicalFileProvider.GetFullPath(String path)
         at Microsoft.AspNet.FileProviders.PhysicalFileProvider.GetDirectoryContents(String subpath)
         at Microsoft.AspNet.StaticFiles.DefaultFilesMiddleware.Invoke(HttpContext context) in C:\git\Universe\StaticFiles\src\Microsoft.AspNet.StaticFiles\DefaultFilesMiddleware.cs:line 66
         at Microsoft.AspNet.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at Microsoft.AspNet.Hosting.Internal.HostingEngine.<>c__DisplayClass32_0.<<Start>b__0>d.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at Microsoft.AspNet.Server.WebListener.MessagePump.<ProcessRequestAsync>d__23.MoveNext()

PhysicalFileProvider.GetDirectoryContents should not throw in this scenario.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions