src/security/samples/StaticFilesAuth always not working #43274
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
investigate
Milestone
Is there an existing issue for this?
Describe the bug
Hi, When I tried to run the sample in : src/Security/Sampels/StaticFilesAuth, look like it was broken. would you help us take a look?
when I tried to run the sample, after login, access the url: /https://localhost:5001/MapAuthenticatedFiles
it willreport Exception:
I tried to debug into.
I found it will jump here:
the werid thing is: it will run into branch.Use( (context, next) => {} ), and then the pipeline was end, will not go through
would you help to take a look?
thanks
Expected Behavior
it should work success
Steps To Reproduce
No response
Exceptions (if any)
System.InvalidOperationException: The request reached the end of the pipeline without executing the endpoint: '/'. Please register the EndpointMiddleware using 'IApplicationBuilder.UseEndpoints(...)' if using routing.
at Microsoft.AspNetCore.Builder.ApplicationBuilder.<>c.b__18_0(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.DirectoryBrowserMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.DefaultFilesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
.NET Version
6.0.400
Anything else?
No response
The text was updated successfully, but these errors were encountered: