-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show an error page if libs folder is empty. #20565
Conversation
…cUiBundlingModule`.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## rel-8.3 #20565 +/- ##
==========================================
Coverage ? 52.29%
==========================================
Files ? 3142
Lines ? 100320
Branches ? 7568
==========================================
Hits ? 52467
Misses ? 46279
Partials ? 1574 ☔ View full report in Codecov by Sentry. |
protected virtual Task<bool> CheckLibsAsync(HttpContext httpContext) | ||
{ | ||
var fileProvider = new PhysicalFileProvider(httpContext.RequestServices.GetRequiredService<IWebHostEnvironment>().WebRootPath); | ||
var libsFolder = fileProvider.GetDirectoryContents("/libs"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this code is likely to throw an exception, for example if the libs
folder cannot be retrieved due to file system permissions, you need to handle the exception.
I throws this exception even if its a /connect request. I think "libs" check should only be applied for non api requests. |
hi @mtozlu The check is only done once during the app's start. So there is no request. |
There's a middleware which suggests it is checked in each request. Am I missing something? I encountered this problem where I get this "libs folder" error page in response to /connect token request. |
hi @mtozlu Sorry, I misremembered. I will add some checks to skip the Thanks |
Thanks for the quick addition ^^ |
Resolve #20559
The
_checkLibsTask
will cache the task. It will execute once and won't affect performance.