You are here

datadome_integration_deliver.html.twig in Fastly 8.3

# copy datadome headers if it isn't datadome request
if (req.backend != datadome) {
declare local var.x-datadome-headers STRING;
set var.x-datadome-headers = urldecode(req.http.x-datadome-headers-pairs:x-datadome-headers);
if (var.x-datadome-headers ~ "(?i)(^| )+x-set-cookie( |$)+") {
set resp.http.x-set-cookie = urldecode(req.http.x-datadome-headers-pairs:x-set-cookie);
}
if (var.x-datadome-headers ~ "(?i)(^| )+x-datadome-server( |$)+") {
set resp.http.x-datadome-server = urldecode(req.http.x-datadome-headers-pairs:x-datadome-server);
}
if (var.x-datadome-headers ~ "(?i)(^| )+x-datadome( |$)+") {
set resp.http.x-datadome = urldecode(req.http.x-datadome-headers-pairs:x-datadome);
}
if (var.x-datadome-headers ~ "(?i)(^| )+content-type( |$)+") {
set resp.http.content-type = urldecode(req.http.x-datadome-headers-pairs:content-type);
}
if (var.x-datadome-headers ~ "(?i)(^| )+charset( |$)+") {
set resp.http.charset = urldecode(req.http.x-datadome-headers-pairs:charset);
}
if (var.x-datadome-headers ~ "(?i)(^| )+cache-control( |$)+") {
set resp.http.cache-control = urldecode(req.http.x-datadome-headers-pairs:cache-control);
}
if (var.x-datadome-headers ~ "(?i)(^| )+pragma( |$)+") {
set resp.http.pragma = urldecode(req.http.x-datadome-headers-pairs:pragma);
}
if (var.x-datadome-headers ~ "(?i)(^| )+access-control-allow-credentials( |$)+") {
set resp.http.access-control-allow-credentials = urldecode(req.http.x-datadome-headers-pairs:access-control-allow-credentials);
}
if (var.x-datadome-headers ~ "(?i)(^| )+access-control-expose-headers( |$)+") {
set resp.http.access-control-expose-headers = urldecode(req.http.x-datadome-headers-pairs:access-control-expose-headers);
}
if (var.x-datadome-headers ~ "(?i)(^| )+access-control-allow-origin( |$)+") {
set resp.http.access-control-allow-origin = urldecode(req.http.x-datadome-headers-pairs:access-control-allow-origin);
}
if (var.x-datadome-headers ~ "(?i)(^| )+x-datadome-cid( |$)+") {
set resp.http.x-datadome-cid = urldecode(req.http.x-datadome-headers-pairs:x-datadome-cid);
}
if (var.x-datadome-headers ~ "(?i)(^| )+x-dd-b( |$)+") {
set resp.http.x-dd-b = urldecode(req.http.x-datadome-headers-pairs:x-dd-b);
}
if (var.x-datadome-headers ~ "(?i)(^| )+x-dd-type( |$)+") {
set resp.http.x-dd-type = urldecode(req.http.x-datadome-headers-pairs:x-dd-type);
}
# don't forget about ApiServer's cookies
if (var.x-datadome-headers ~ "(?i)(^| )+set-cookie( |$)+") {
add resp.http.set-cookie = urldecode(req.http.x-datadome-headers-pairs:set-cookie);
}
}

File

fastly_edge_modules/templates/datadome_integration_deliver.html.twig
View source
  1. # copy datadome headers if it isn't datadome request
  2. if (req.backend != datadome) {
  3. declare local var.x-datadome-headers STRING;
  4. set var.x-datadome-headers = urldecode(req.http.x-datadome-headers-pairs:x-datadome-headers);
  5. if (var.x-datadome-headers ~ "(?i)(^| )+x-set-cookie( |$)+") {
  6. set resp.http.x-set-cookie = urldecode(req.http.x-datadome-headers-pairs:x-set-cookie);
  7. }
  8. if (var.x-datadome-headers ~ "(?i)(^| )+x-datadome-server( |$)+") {
  9. set resp.http.x-datadome-server = urldecode(req.http.x-datadome-headers-pairs:x-datadome-server);
  10. }
  11. if (var.x-datadome-headers ~ "(?i)(^| )+x-datadome( |$)+") {
  12. set resp.http.x-datadome = urldecode(req.http.x-datadome-headers-pairs:x-datadome);
  13. }
  14. if (var.x-datadome-headers ~ "(?i)(^| )+content-type( |$)+") {
  15. set resp.http.content-type = urldecode(req.http.x-datadome-headers-pairs:content-type);
  16. }
  17. if (var.x-datadome-headers ~ "(?i)(^| )+charset( |$)+") {
  18. set resp.http.charset = urldecode(req.http.x-datadome-headers-pairs:charset);
  19. }
  20. if (var.x-datadome-headers ~ "(?i)(^| )+cache-control( |$)+") {
  21. set resp.http.cache-control = urldecode(req.http.x-datadome-headers-pairs:cache-control);
  22. }
  23. if (var.x-datadome-headers ~ "(?i)(^| )+pragma( |$)+") {
  24. set resp.http.pragma = urldecode(req.http.x-datadome-headers-pairs:pragma);
  25. }
  26. if (var.x-datadome-headers ~ "(?i)(^| )+access-control-allow-credentials( |$)+") {
  27. set resp.http.access-control-allow-credentials = urldecode(req.http.x-datadome-headers-pairs:access-control-allow-credentials);
  28. }
  29. if (var.x-datadome-headers ~ "(?i)(^| )+access-control-expose-headers( |$)+") {
  30. set resp.http.access-control-expose-headers = urldecode(req.http.x-datadome-headers-pairs:access-control-expose-headers);
  31. }
  32. if (var.x-datadome-headers ~ "(?i)(^| )+access-control-allow-origin( |$)+") {
  33. set resp.http.access-control-allow-origin = urldecode(req.http.x-datadome-headers-pairs:access-control-allow-origin);
  34. }
  35. if (var.x-datadome-headers ~ "(?i)(^| )+x-datadome-cid( |$)+") {
  36. set resp.http.x-datadome-cid = urldecode(req.http.x-datadome-headers-pairs:x-datadome-cid);
  37. }
  38. if (var.x-datadome-headers ~ "(?i)(^| )+x-dd-b( |$)+") {
  39. set resp.http.x-dd-b = urldecode(req.http.x-datadome-headers-pairs:x-dd-b);
  40. }
  41. if (var.x-datadome-headers ~ "(?i)(^| )+x-dd-type( |$)+") {
  42. set resp.http.x-dd-type = urldecode(req.http.x-datadome-headers-pairs:x-dd-type);
  43. }
  44. # don't forget about ApiServer's cookies
  45. if (var.x-datadome-headers ~ "(?i)(^| )+set-cookie( |$)+") {
  46. add resp.http.set-cookie = urldecode(req.http.x-datadome-headers-pairs:set-cookie);
  47. }
  48. }