abema_unlock.js 731 B

123456789101112131415161718192021222324
  1. /* global $request, $response, $done */
  2. const url = $request.url;
  3. const body = url.endsWith('region') || url.endsWith('region/')
  4. ? 'OK'
  5. : $response.body;
  6. if ($request.method === 'OPTION') {
  7. $done({});
  8. } else {
  9. $done({
  10. status: 200,
  11. body,
  12. headers: {
  13. 'Content-Type': 'text/plain; charset=utf-8',
  14. 'Access-Control-Allow-Origin': '*',
  15. 'Access-Control-Allow-Credentials': '*',
  16. 'Access-Control-Allow-Headers': 'origin,range,hdntl,hdnts',
  17. 'Access-Control-Allow-Methods': 'GET,HEAD,POST,PUT,DELETE,OPTIONS',
  18. 'Access-Control-Expose-Headers': 'Server,range,hdntl,hdnts,Akamai-Mon-Iucid-Ing,Akamai-Mon-Iucid-Del,Akamai-Request-BC',
  19. 'Access-Control-Max-Age': '86400'
  20. }
  21. });
  22. }