-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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: run htmlFallbackMiddleware for no accept header requests #15025
fix: run htmlFallbackMiddleware for no accept header requests #15025
Conversation
/ecosystem-ci run |
📝 Ran ecosystem CI on
|
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'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-fallback
and 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
).