File tree Expand file tree Collapse file tree 4 files changed +5
-0
lines changed
Expand file tree Collapse file tree 4 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class Service {
4747 var ipInfoURL = " https://ipinfo.io "
4848 let headers : HTTPHeaders = [
4949 " Authorization " : " Bearer \( Constants . ACCESS_TOKEN) " ,
50+ " User-Agent " : " IPinfoClient/Swift/ \( Constants . SDK_VERSION) " ,
5051 ]
5152
5253 @MainActor
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ extension IPINFO {
107107 let headers = [
108108 " Authorization " : " Bearer \( Constants . ACCESS_TOKEN) " ,
109109 " Content-Type " : " application/json " ,
110+ " User-Agent " : " IPinfoClient/Swift/ \( Constants . SDK_VERSION) "
110111 ]
111112 // Create the URL request with appropriate method, headers, and body
112113 var request = URLRequest ( url: URL ( string: Service . Router. batch ( withFilter: withFilter) . endPoint) !)
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import Foundation
66open class Constants {
77
88 static let shared = Constants ( )
9+
10+ static var SDK_VERSION : String = " 0.2.0 "
911
1012 /// Getting Application Version from info.plist
1113 static var APP_VERSION : String {
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ open class IPInfoLite {
2323 " accept " : " application/json " ,
2424 " authorization " : " Bearer \( token) " ,
2525 " content-type " : " application/json " ,
26+ " user-agent " : " IPinfoClient/Swift/ \( Constants . SDK_VERSION) " ,
2627 ]
2728
2829 let ( data, response) = try await urlSession. data ( for: urlRequest)
You can’t perform that action at this time.
0 commit comments