AliSoftware / AliSoftware/OHHTTPStubs

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

Đang mở
#82 6 bình luận 0 reaction 1 người được giao Được @AliSoftware nhận Xem trên GitHub
Apple Bug
Ngôn ngữ chính
Objective-C
Star
5.1k
Fork
597
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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;
}];
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.