C
C#2y ago
barcode

Static files asp.net

Hello, in my app I have 2 middlewares that are ran before any request but I want to disable them for static files. These middlewares check for a token but i don't want to force the user to be authorized to access some images.
app.UseStaticFiles();
app.UseMiddleware<AuthMiddleware>();
app.UseMiddleware<AccessMiddleware>();
app.UseStaticFiles();
app.UseMiddleware<AuthMiddleware>();
app.UseMiddleware<AccessMiddleware>();
I can't find anything on documentation nor google how to do this. What is the correct way?
1 Reply
barcode
barcodeOP2y ago
nevermind seems like something else is causing this issue

Did you find this page helpful?