Skip to content

Commit

Permalink
Deprecate old client fingerprint
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBarba committed Mar 20, 2024
1 parent a3d6277 commit 5b1c2c6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Sources/Compute/IncomingRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,19 @@ public struct IncomingRequest: Sendable {

extension IncomingRequest {

public enum ClientFingerprintMethod: Sendable {
@available(*, deprecated, renamed: "TLSFingerptint", message: "Use TLSFingerprint with provided method")
public func clientFingerprint() -> String? {
return try? Fastly.Request.downstreamTLSJA3MD5().hex
}
}

extension IncomingRequest {
public enum TLSFingerprintMethod: Sendable {
case ja3
case ja4
}

public func clientFingerprint(_ method: ClientFingerprintMethod = .ja3) -> String? {
public func TLSFingerprint(_ method: TLSFingerprintMethod) -> String? {
switch method {
case .ja3:
return try? Fastly.Request.downstreamTLSJA3MD5().hex
Expand Down

0 comments on commit 5b1c2c6

Please sign in to comment.