-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
We set custom header fields on the default session configuration which Timberjack removes
To reproduce create a manager in the following way:
class HTTPManager: Manager {
static let sharedManager: HTTPManager = {
let configuration = Timberjack.defaultSessionConfiguration()
let version = NSBundle.mainBundle().infoDictionary!["CFBundleVersion"] as! String
let release = NSBundle.mainBundle().infoDictionary!["CFBundleShortVersionString"] as! String
let device = UIDevice.currentDevice()
configuration.HTTPAdditionalHeaders = [
"User-Agent": "AppName iOS \(release)/\(version); \(device.systemName) \(device.systemVersion))",
"X-Device-Id": "Some generated ID"
]
let manager = HTTPManager(configuration: configuration)
return manager
}()
}
The received request looks like this:
POST /v1/event HTTP/1.1
Host: localhost:3000
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Connection: keep-alive
Accept: */*
User-Agent: AppName/54 CFNetwork/711.4.6 Darwin/15.4.0
Content-Length: 81
Accept-Language: en-us
Accept-Encoding: gzip, deflate
The expected header should look like this:
POST /v1/event HTTP/1.1
Host: localhost:3000
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Connection: keep-alive
X-Device-Id: Some generated ID
Accept: */*
User-Agent: AppName iOS 0.6.0/54; iPhone OS 8.4)
Content-Length: 81
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels