Closed avanderhoorn closed 7 years ago
Yes, this is a known limitation of EmbeddedFileProvider and that's where any enhancements would need to be made.
I'm happy to bring this up there, but before putting further energy into this, I wanted to see if there is any desire to support this use case?
It has come up before, though I can't find the thread at the moment. Yes, it would be nice to make it work eventually.
This issue was moved to aspnet/FileSystem#255
The behaviour of
DefaultFilesMiddleware
doesn't seem quite right when used in conjunction withEmbeddedFileProvider
and subpaths. Specifically if my url was "localhost:3000/static/client/" and myEmbeddedFileProvider
sbaseNamespace
was setup to point tostatic
, I would expect that translate through to and look for "localhost:3000/static/client/index.html"... this is not the case however.Specifically, in scenarios where the
EmbeddedFileProvider
has been setup as described, theDefaultFilesMiddleware
fails to find a match as thesubpath.Value
(in the first link below below) is equal to/client/
which causes theEmbeddedFileProvider
to short circuit (in the second link below):Based on the comment in
GetDirectoryContents
, I understand why this is the case -// Non-hierarchal.
but in the context of how this is used withinDefaultFilesMiddleware
it seems like the wrong decision, or at the very least, very limiting - as the way the logic is setup, it can only ever support matching defaults at the root level.I can think of a few different solutions to this problem, but before putting further energy into this, I wanted to see if there is any desire to support this use case?