AliSoftware / AliSoftware/OHHTTPStubs
User-Agent is missing from `NSURLRequest` in `stubRequestsPassingTest:...` when using `NSURLSessionConfiguraiton`?
- Lingua principale
- Objective-C
- Stelle
- 5.1k
- Fork
- 597
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I am setting up the userAgent string using `NSURLSessionConfiguraiton`:
```
NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
config.HTTPAdditionalHeaders = @{ @"User-Agent": @"Test User Agent" };
NSURLSession *session = [NSURLSession sessionWithConfiguration:config];
```
The User-Agent is being sent over the network - I can see it using Charles Proxy. However, it is not coming though in the stub checker:
```
[OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
NSDictionary* headers = request.allHTTPHeaders;
// `headers` does not contain the user agent entry
return YES;
} withStubResponse:^OHHTTPStubsResponse*(NSURLRequest *request) {
return nil;
}];
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.