Skip to content
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

Should History API fallback use HTTP content negotiation? #81

Open
ezzatron opened this issue Sep 9, 2021 · 0 comments
Open

Should History API fallback use HTTP content negotiation? #81

ezzatron opened this issue Sep 9, 2021 · 0 comments

Comments

@ezzatron
Copy link

ezzatron commented Sep 9, 2021

Hey there, I was looking at the implementation here as a I guide for the correct way to implement fallback in my own application. I noticed this package is using HTTP content negotiation. I had considered that approach myself in the past, since it seems to work nicely to avoid getting served HTML in inappropriate contexts. But I have some concerns that maybe there are problems with the approach too.

I went to the trouble of writing up a StackOverflow question going into more detail. I thought you might be interested, seeing as this package is probably the most popular implementation of History API fallback in the JS ecosystem.

To summarize, my concerns are mostly around the use of 404 responses instead of 406 responses when a request indicates that HTML is not acceptable, and also potential HTTP caching issues arising from not utilizing the Vary header to indicate that the response must be cached independently for each value of the request's Accept header. In particular, these two things don't really seem to match up with how HTTP content negotiation is intended to work.

Anyway, I was wondering if you had some insight about the content negotiation aspect of the implementation in this package. Maybe there's something I'm misunderstanding?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant