summaryrefslogtreecommitdiffstats
path: root/toolkit/components/normandy/test/browser/action_server.sjs
blob: 5d6a3e6bb08a3ae52842dfbbe40fb34134308853 (plain)
1
2
3
4
5
6
7
8
9
10
// Returns JS for an action, regardless of the URL.
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);

  // Write response body
  response.write('registerAsyncCallback("action", async () => {});');
}