Skip to content

Commit

Permalink
fix: user-agent fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Eywek committed Oct 10, 2022
1 parent 94e2c5e commit 18bce12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/ReelevantAnalytics/ReelevantAnalytics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public struct ReelevantAnalytics {
var request = URLRequest(url: url)
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
// Avoid being considered as a bot
request.setValue(WKWebView().value(forKey: "userAgent"), forHTTPHeaderField: "User-Agent")
request.setValue(WKWebView().value(forKey: "userAgent") as? String ?? "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36", forHTTPHeaderField: "User-Agent")
request.httpMethod = "POST"
request.httpBody = body

Expand Down

0 comments on commit 18bce12

Please sign in to comment.