Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmsano committed Jul 15, 2021
1 parent 1622cd6 commit 7cd2f73
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ingestly.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ table apikeys {
sub vcl_recv {
#FASTLY recv
if(table.lookup(apikeys, subfield(req.url.qs, "key", "&")) != "true"){
# Invalid API Key (if you configure Fastly to use only for Ingestly, use the below.)
# error 401 "Unauthorized";
if(req.url ~ "^\.well-known\/attribution-reporting\/.*" || req.url ~ "^\.well-known\/private-click-measurement\/.*"){
# Attribution Reporting & Private Click Measurement
error 200 "OK";
}else{
# Invalid API Key (if you configure Fastly to use only for Ingestly, use the below.)
# error 401 "Unauthorized";
}
}else{
if(req.url ~ "^/ingestly-ingest/(.*?)/\?.*" || req.url ~ "^/ingestly-consent/(.*?)/\?.*" || req.url ~ "^/ingestly-bulk/(.*?)/\?.*"){
# Valid Ingestion
error 204 "No Content";
}else if(req.url ~ "^/ingestly-sync/(.*?)/\?.*"){
# Valid Sync (< 1.0.0)
error 200 "OK";
}else if(req.url ~ "^\.well-known\/attribution-reporting\/.*" || req.url ~ "^\.well-known\/private-click-measurement\/.*"){
# Attribution Reporting & Private Click Measurement
error 200 "OK";
}else{
# Invalid Request (if you configure Fastly to use only for Ingestly, use the below.)
# error 400 "Bad Request";
Expand Down

0 comments on commit 7cd2f73

Please sign in to comment.