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

StaticFiles throws in _fileProvider.GetFileInfo on /.%20./ #204

Closed
Tratcher opened this issue Jun 10, 2016 · 0 comments
Closed

StaticFiles throws in _fileProvider.GetFileInfo on /.%20./ #204

Tratcher opened this issue Jun 10, 2016 · 0 comments
Assignees

Comments

@Tratcher
Copy link
Member

From @cweb on June 9, 2016 22:57

Sending a request of GET /bar/.%20./foo.txt HTTP/1.1 or GET /bar/%20./foo.txt HTTP/1.1

Throws an unhandled ArgumentException at:

        public bool LookupFileInfo()
        {
            _fileInfo = _fileProvider.GetFileInfo(_subPath.Value);  <<<<<<<<<<<<<<<<< unhandled exception here
An exception of type 'System.ArgumentException' occurred in mscorlib.dll but was not handled in user code

Additional information: The path is not of a legal form.

   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.GetFullPathInternal(String path)
   at Microsoft.Extensions.FileProviders.PhysicalFileProvider.GetFullPath(String path)
   at Microsoft.Extensions.FileProviders.PhysicalFileProvider.GetFileInfo(String subpath)
   at Microsoft.AspNetCore.StaticFiles.StaticFileContext.LookupFileInfo() in C:\Users\casaba\Documents\StaticFiles\src\Microsoft.AspNetCore.StaticFiles\StaticFileContext.cs:line 141
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) in C:\Users\casaba\Documents\StaticFiles\src\Microsoft.AspNetCore.StaticFiles\StaticFileMiddleware.cs:line 86
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()

Copied from original issue: aspnet/StaticFiles#137

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

2 participants