-
-
Notifications
You must be signed in to change notification settings - Fork 477
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
Add support for custom XHR headers #655
Comments
Hi @julesvaulont, Sorry for the late reply. As of today, I don't think/remember that it's possible to set custom HTTP headers inside a Barba request. But I will tag this as feature enhancement 😉 |
Thank your for your answer! |
@xavierfoucrier Hello! Thanks for the awesome library! I'd like to +1 to the custom HTTP headers feature. In my case it's related to serving of optimized images in The common practice to detect if a browser supports WEBP is checking
This rewrite works perfectly fine for me as long as the site pages are requested initially (or on hard browser refresh). However when Barba is doing an XHR request to the next page, it sends only The ability to setup an additional custom HTTP headers would perfectly solve the issue I've mentioned. |
Is there a way to add: xhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest") to an BarbaJS request?
When I want to do an ajax call in Vanilla JS (without barba) I usually do:
Whatever thanks for this super great lib.
The text was updated successfully, but these errors were encountered: