-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fix missing images everywhere when running locally #2019
Conversation
Build failure is here:
I'm not sure how to get an IHostEnvironment at that point. DI via a constructor parameter prevents the test from running.
|
You have to mock it |
Is this the right place to insert a dev fallback? It relies on the broken links to be redirected to the wiki endpoint. |
I looked and I see no way to do this kind of routing with UseStaticFiles. The best I found is to put some custom middleware, but thsi would mean that we would either always have the dummy images locally (which i do not want, since I have the correct ones) or the middleware would need to do some kind of check if the image exists, which we get for free with this approach. This might be a bit hacky but I don't see a less hacky alternative |
@adelikat I mentioned doing it by overriding the StaticFileOptions.FileProvider in the UseStaticFiles call with our own IFileProvider implementation that does this. |
I would need an example. I tried to do that approach and it seemed impossible |
I can give an example in a week if that's okay. |
Closing in favor of this approach: #2062 |
Before/after:
Only has effect in dev environments.