Fix IWebInterface with root WebPath

This commit is contained in:
Łukasz Domeradzki
2024-04-20 23:37:57 +02:00
parent b1a64e346c
commit 0f30a0ef3d

View File

@@ -194,13 +194,16 @@ internal static class ArchiKestrel {
// Add support for static files from custom plugins (e.g. HTML, CSS and JS)
foreach ((string physicalPath, string webPath) in pluginPaths) {
app.UseStaticFiles(
new StaticFileOptions {
FileProvider = new PhysicalFileProvider(physicalPath),
OnPrepareResponse = OnPrepareResponse,
RequestPath = webPath
}
);
StaticFileOptions options = new() {
FileProvider = new PhysicalFileProvider(physicalPath),
OnPrepareResponse = OnPrepareResponse
};
if (webPath != "/") {
options.RequestPath = webPath;
}
app.UseStaticFiles(options);
}
// Add support for static files (e.g. HTML, CSS and JS from IPC GUI)