AliSoftware / AliSoftware/OHHTTPStubs
User-Agent is missing from `NSURLRequest` in `stubRequestsPassingTest:...` when using `NSURLSessionConfiguraiton`?
- 主要語言
- Objective-C
- 星號
- 5.1k
- 分支
- 597
- PR 合併指標
- 30 天內沒有已合併 PR
描述
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;
}];
```
貢獻指南
這個儲存庫沒有索引到貢獻指南
評估
這個 Issue 還沒有評估資料。