コード例 #1
0
#pragma warning disable CA1801 // Unused parameters - Must respect FileRequestHandlerCallback signature.
        /// <summary>
        /// <para>Unconditionally passes a request down the module chain.</para>
        /// </summary>
        /// <param name="context">A <see cref="IHttpContext"/> interface representing the context of the request.</param>
        /// <param name="info">If the requested path has been successfully mapped to a resource (file or directory), the result of the mapping;
        /// otherwise, <see langword="null"/>.</param>
        /// <returns>This method never returns; it throws an exception instead.</returns>
        public static Task PassThrough(IHttpContext context, MappedResourceInfo info)
        => throw RequestHandler.PassThrough();
コード例 #2
0
 /// <summary>
 /// <para>Unconditionally sends a <c>403 Unauthorized</c> response.</para>
 /// </summary>
 /// <param name="context">A <see cref="IHttpContext"/> interface representing the context of the request.</param>
 /// <param name="info">If the requested path has been successfully mapped to a resource (file or directory), the result of the mapping;
 /// otherwise, <see langword="null"/>.</param>
 /// <returns>This method never returns; it throws a <see cref="HttpException"/> instead.</returns>
 public static Task ThrowUnauthorized(IHttpContext context, MappedResourceInfo info)
 => throw HttpException.Unauthorized();
コード例 #3
0
 private static MappedResourceInfo GetMappedDirectoryInfo(DirectoryInfo info)
 => MappedResourceInfo.ForDirectory(info.FullName, info.Name, info.LastWriteTimeUtc);