-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Change MapBlazorWebAssemblyApplication to UseBlazorFrameworkFiles #19198
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
Change MapBlazorWebAssemblyApplication to UseBlazorFrameworkFiles #19198
Conversation
javiercn
commented
Feb 20, 2020
- We discovered some issues with the interactions between static files and endpoint routing and we need to re-assess the design.
- In the mean time, we go back to MapBlazorFrameworkFiles that only handles _framework files
091c17f
to
f82f661
Compare
f82f661
to
e745d3a
Compare
What are the strange interactions? |
@rynowak Ordering issues. I plan to talk to you about them and see if we can come up with a solution together. We just don't have time to do something better for preview2. |
src/Components/WebAssembly/Server/src/ComponentsWebAssemblyApplicationBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/WebAssembly/Server/src/ComponentsWebAssemblyApplicationBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/WebAssembly/Server/src/ComponentsWebAssemblyApplicationBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/WebAssembly/Server/src/ComponentsWebAssemblyApplicationBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/WebAssembly/Server/src/ComponentsWebAssemblyApplicationBuilderExtensions.cs
Show resolved
Hide resolved
{ | ||
var endpoint = ctx.GetEndpoint(); | ||
try | ||
subBuilder.Use(async (ctx, next) => |
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.
Out of interest, would an alternative working implementation have been to configure the "on prepare response" callback for options
and put the header controls in there, then just have subBuilder.UseStaticFiles(options)
without the extra bit of middleware?
I'm not saying that's better. Just want to understand the options.
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.
I just did the most straightforward transformation from what we had before, using OnPrepareResponse would have also worked.
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.
I think the difference you'd seen in behavior here is that OnPrepareResponse would handle the cases where the file was found - this will add a header for a 404.
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.
Yeah, I think you are right, not a big deal since I plan to work on this for preview 3 and a 404 can’t be cached anyways?
Thanks Steve! Co-Authored-By: Steve Sanderson <[email protected]>