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

NotSupportedException for URLs with special characters #137

Closed
Tratcher opened this issue Oct 29, 2015 · 2 comments
Closed

NotSupportedException for URLs with special characters #137

Tratcher opened this issue Oct 29, 2015 · 2 comments
Assignees
Milestone

Comments

@Tratcher
Copy link
Member

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.

@Tratcher Tratcher added the bug label Oct 29, 2015
@muratg muratg added this to the 1.0.0-rc2 milestone Nov 19, 2015
@muratg
Copy link

muratg commented Nov 19, 2015

@BrennanConroy Another repo :)

@BrennanConroy
Copy link
Member

158dc43

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants