Skip to content

Commit

Permalink
BDOG-1512 Make deviceId extraction logic more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-lamed committed Apr 5, 2022
1 parent 9132c8d commit 4429996
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ trait HeaderCarrierConverter {
trueClientPort = headers.get(HeaderNames.trueClientPort),
gaToken = headers.get(HeaderNames.googleAnalyticTokenId),
gaUserId = headers.get(HeaderNames.googleAnalyticUserId),
deviceID = session.fold(headers.get(HeaderNames.deviceID))(_ =>
cookies.get(CookieNames.deviceID).map(_.value)
.fold[Option[String]](headers.get(HeaderNames.deviceID))(Some(_))
),
deviceID = session.flatMap(_ => cookies.get(CookieNames.deviceID).map(_.value))
.orElse(headers.get(HeaderNames.deviceID)),
akamaiReputation = headers.get(HeaderNames.akamaiReputation).map(AkamaiReputation),
otherHeaders = otherHeaders(headers, request)
)
Expand Down

0 comments on commit 4429996

Please sign in to comment.