Signal-iOS/SignalServiceKit/tests
Max Radermacher 0fb57a74ae
Fix various bugs in OWSHttpHeaders
First, `OWSHttpHeaders(httpHeaders:)` completely ignored its argument.
This doesn’t actually seem to have led to any bugs in practice; one time
the caller appears to have worked around the bug by adding the headers
again, and another time the caller relied on `allHTTPHeaderFields`
ignoring unrelated values.

Second, `URLRequest` has both `addValue` and `setValue` methods for its
headers. The former will construct a comma-separated list if the header
is already set, and the latter will replace it if it’s already set. (If
the header hasn’t been set, the two are equivalent, which is why call
sites weren’t broken even though they used the wrong method.) This was
broken only in multi-part uploads, but it was broken for "User-Agent"
and "Accept-Language", both of which are non-critical.

Third, `URLRequest`’s `allHTTPHeaderFields` doesn’t behave the way you
might expect. There’s a unit test which demonstrates some of the weird
behaviors, but any fields that aren’t present in the assigned value
aren’t touched. It seems as though most code was written as if calling
this method would fully replace *all* the HTTP headers. (The
`replace(…)` and `removeAllHeaders` methods have been removed because
they didn’t do what you’d think, and they weren’t necessary.)

Also:
* Remove Obj-C support from OWSHttpHeaders
* Move & simplify tests for HTTP Retry-After header
* Remove unused `asConnectionFailureError` method
2022-11-22 11:43:55 -08:00
..
Account Change license to AGPL 2022-10-13 08:25:37 -05:00
Contacts Add ContactDiscoveryManager 2022-11-15 13:37:28 -08:00
Devices Change license to AGPL 2022-10-13 08:25:37 -05:00
Fixtures Improvements to PNG transcoding 2022-09-13 23:22:50 +00:00
Groups Change license to AGPL 2022-10-13 08:25:37 -05:00
Messages Swiftify OWSDisappearingMessageFinderTest 2022-11-16 00:21:23 -08:00
Network Fix various bugs in OWSHttpHeaders 2022-11-22 11:43:55 -08:00
Protos Change license to AGPL 2022-10-13 08:25:37 -05:00
Security Change license to AGPL 2022-10-13 08:25:37 -05:00
Storage Change license to AGPL 2022-10-13 08:25:37 -05:00
Stories Use read state for the stories tab bar badge 2022-10-18 16:22:50 -07:00
Util Fix various bugs in OWSHttpHeaders 2022-11-22 11:43:55 -08:00
SSKBaseTestObjC.h Change license to AGPL 2022-10-13 08:25:37 -05:00
SSKBaseTestObjC.m Change license to AGPL 2022-10-13 08:25:37 -05:00
SSKBaseTestSwift.swift Change license to AGPL 2022-10-13 08:25:37 -05:00
SSKSwiftTests.swift Change license to AGPL 2022-10-13 08:25:37 -05:00