Skip to content

Commit f340998

Browse files
authored
Merge pull request #822 from syphar/source-cdn-header
docs-rs / fastly: add header to differentiate between cloudfront & fastly traffic
2 parents 785cb52 + 85847e3 commit f340998

File tree

1 file changed

+3
-0
lines changed
  • terraform/docs-rs/fastly-compute-docs-rs/src

1 file changed

+3
-0
lines changed

terraform/docs-rs/fastly-compute-docs-rs/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const X_ROBOTS_TAG: HeaderName = HeaderName::from_static("x-robots-tag");
1818
const X_ORIGIN_AUTH: HeaderName = HeaderName::from_static("x-origin-auth");
1919
const X_COMPRESS_HINT: HeaderName = HeaderName::from_static("x-compress-hint");
2020

21+
const X_RLNG_SOURCE_CDN: HeaderName = HeaderName::from_static("x-rlng-source-cdn");
22+
2123
#[fastly::main]
2224
fn main(mut req: Request) -> Result<Response, Error> {
2325
let secrets = SecretStore::open(DOCS_RS_SECRET_STORE).expect("failed to open secret store");
@@ -71,6 +73,7 @@ fn main(mut req: Request) -> Result<Response, Error> {
7173
}
7274

7375
req.set_header(X_ORIGIN_AUTH, origin_auth.as_ref());
76+
req.set_header(X_RLNG_SOURCE_CDN, "fastly");
7477

7578
// Send request to backend
7679
let mut resp = req.send(DOCS_RS_BACKEND)?;

0 commit comments

Comments
 (0)