Some users [are unable to register][1] because the server [returns a 400
error][2] if passed an invalid `Accept-Language` header.
This commit helps prevent two possible error modes:
- Filters out invalid language tags. Some users reported a "Workshopx"
language, which the server would reject because it's syntactically
invalid. Deleting this language (at the OS level) let them register.
- If no languages are valid, we should send `*` instead of the empty
string. There's no evidence that this happened in practice.
In addition, this commit:
- Adds tests.
- Sends a maximum of 10 languages instead of 6.
- Omits the `q` value when it's 1 because [that's the default][3].
- Marginally improves performance by iterating lazily.
[1]: https://github.com/signalapp/Signal-iOS/issues/5261
[2]:
|
||
|---|---|---|
| .. | ||
| protobuf | ||
| Resources | ||
| src | ||
| tests | ||
| Utilities | ||
| .clang-format | ||
| .gitignore | ||
| .travis.yml | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
SignalServiceKit
SignalServiceKit is an Objective-C library for communicating with the Signal messaging service for iOS & OS X
To use SignalServiceKit via CocoaPods add the following to your Podfile
pod 'SignalServiceKit', git: 'https://github.com/signalapp/Signal-iOS.git'