fix: run htmlFallbackMiddleware for no accept header requests#15025
fix: run htmlFallbackMiddleware for no accept header requests#15025patak-dev merged 1 commit intovitejs:mainfrom
Conversation
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI on
|
bluwy
left a comment
There was a problem hiding this comment.
I'm ok with this if this is the more expected behaviour from users 👍
I'm also fine with removing the application/json check. From connect-history-api-fallback, I found that it's added because some people don't expect HTML files to be served for application/json;*/*, and some expect otherwise #9520 (comment). But I don't think this is an issue for us.
|
Thanks for this fix! I stumbled upon it due to a case where For what it's worth, the |
|
Whoops, I forgot to mention in #15025 (comment) that I verified that the problem is fixed in Vite 5.0.2. ✅ The original intent behind the comment was to capture what seemed like a different case from a missing |
Description
fixes #9520
fixes #15022
Additional context
https://github.com/bripkens/connect-history-api-fallback does this check.
https://github.com/bripkens/connect-history-api-fallback/blob/74564d61c2db06e302923a23bd459bb5dd91712b/lib/index.js#L11-L43
I also think this middleware should not check
Accept: application/json. But I didn't change that because this part also comes fromconnect-history-api-fallbackand didn't want to change the behavior much.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).