summaryrefslogtreecommitdiffstats
path: root/toolkit/components/normandy/test/unit/cookie_server.sjs
blob: ab6099f6a4630b4c137cfabc6e31eb5cc621a94d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/**
 * Sends responses that sets a cookie.
 */
function handleRequest(request, response) {
  // Allow cross-origin, so you can XHR to it!
  response.setHeader("Access-Control-Allow-Origin", "*", false);
  // Avoid confusing cache behaviors
  response.setHeader("Cache-Control", "no-cache", false);
  // Set a cookie
  response.setHeader("Set-Cookie", "type=chocolate-chip", false);
  response.write("");
}