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

Invalid characters in the request URL causes an ArgumentException to be raised #84

@brentnewbury

Description

@brentnewbury

A request with invalid characters (e.g. /%3C [edit] which is URL decoded to <) causes an ArgumentException to be raised. This produces an HTTP 500 error to be returned to the client, rather than the expected HTTP 404.

Below if the stack trace from the exception:

ArgumentException: Illegal characters in path.
System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
System.IO.Path.GetExtension(String path)
Microsoft.AspNet.StaticFiles.FileExtensionContentTypeProvider.TryGetContentType(String subpath, String& contentType)
Microsoft.AspNet.StaticFiles.StaticFileContext.LookupContentType()
Microsoft.AspNet.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions