netwerk/test/mochitests/rel_preconnect.sjs
author Patrick McManus <mcmanus@ducksong.com>
Fri, 19 Jun 2015 17:11:42 -0400
changeset 250294 a7c6156a485aa71dfcf5328894881a98d9e1f4e8
parent 249362 dbb334e7ebebae1408c0d03f2baad227a340e7aa
child 285806 c4d101e34585cb7950189fc1f4aa0bf99dec8041
permissions -rw-r--r--
bug 1174152 - crossorigin attribute for link rel=preconnect r=hsivonen

// Generate response header "Link: <HREF>; rel=preconnect"
// HREF is provided by the request header X-Link

function handleRequest(request, response)
{
    response.setHeader("Cache-Control", "no-cache", false);
    response.setHeader("Link", "<" + 
                       request.getHeader('X-Link') +
                       ">; rel=preconnect" + ", " +
                        "<" + 
                       request.getHeader('X-Link') +
                       ">; rel=preconnect; crossOrigin=anonymous");
    response.write("check that header");
}