AliSoftware / AliSoftware/OHHTTPStubs

User-Agent is missing from `NSURLRequest` in `stubRequestsPassingTest:...` when using `NSURLSessionConfiguraiton`?

オープン
#82 コメント 6 件 リアクション 0 件 担当者 1 名 @AliSoftware が担当を希望しています GitHub で見る
Apple Bug
主要言語
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。