DefaultFilesMiddleware Class

Definition

This examines a directory path and determines if there is a default file present. If so the file name is appended to the path and execution continues. Note we don't just serve the file because it may require interpretation.

C#
public class DefaultFilesMiddleware
Inheritance
DefaultFilesMiddleware

Constructors

Methods

Invoke(HttpContext)

This examines the request to see if it matches a configured directory, and if there are any files with the configured default names in that directory. If so this will append the corresponding file name to the request path for a later middleware to handle.

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0