In light of Cloudflare's new support for HTTP2 server push, I'm attempting to preload an AJAX request which runs in Javascript at the end of the HTML body. Testing is done in Chrome Canary. The request is made in the headers, so it can be cached for immediate load when requested again.
The header is:
Link: </request>; rel=preload;
This successfully fires off to that https://www.example.org/request. The request headers it sends to that URL are:
Accept: */*
Referer: https://www.example.org/request
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2726.0 Safari/537.36
X-Requested-With: XMLHttpRequest
The problem is that cookie data isn't sent with the preload request, but is sent with the existing Javascript. I can find no information at all about how to fix this or even whether it is correct behaviour. There appears to be no mention of cookies in the spec, so presumably it should be handled as any other type of request.