Skip to content

Commit fbba839

Browse files
committed
fsthttp: add FastlyKeyIsValid
1 parent 8072891 commit fbba839

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fsthttp/request.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,11 @@ func (req *Request) Fingerprint() (*Fingerprint, error) {
386386
return nil, fmt.Errorf("get ddos detected: %w", err)
387387
}
388388

389+
fingerprint.FastlyKeyIsValid, err = req.abi.req.DownstreamFastlyKeyIsValid()
390+
if err != nil {
391+
return nil, fmt.Errorf("get fastly key is valid: %w", err)
392+
}
393+
389394
req.fingerprint = &fingerprint
390395

391396
return req.fingerprint, nil
@@ -1043,6 +1048,9 @@ type Fingerprint struct {
10431048

10441049
// DDOSDetected is true if the request was determined to be part of a DDOS attack.
10451050
DDOSDetected bool
1051+
1052+
// FastlyKeyIsValid is true if the request contains a valid Fastly API token.
1053+
FastlyKeyIsValid bool
10461054
}
10471055

10481056
// DecompressResponseOptions control the auto decompress response behaviour.

0 commit comments

Comments
 (0)