envoy-mobile
envoy-mobile copied to clipboard
Add subscript accessor to Headers
Add a more ergonomic way to access header values stored by Headers. This is for both iOS and Android.
The Swift implementation could look like:
subscript(name: String) -> [String]? {
get {
return self.container.value(forName: name)
}
}
Confirmed that the implementation of transcript accessor is possible in Kotlin too:
operator fun get(i: SomeType) : SomeOtherType { /* */ }
Documentation https://kotlinlang.org/docs/operator-overloading.html#indexed-access-operator
@jpsim I am planning to add transcript operators to Headers and keeping value(forName: methods on Headers at the same time. Users will have two ways to access headers in a case-insensitive way. Let me know if you think that we should get rid of value(forName: option.