mirror of
https://github.com/apple/swift-http-structured-headers
synced 2026-11-25 04:47:48 +00:00
Additional testing
This commit is contained in:
1 parent
49370cd8db
commit
e6e0c68caf
8 files changed
+271
-32
No files matched your search
@@ -26,8 +26,16 @@ struct _StructuredHeaderCodingKey : CodingKey {
|
||||
self.intValue = intValue
|
||||
}
|
||||
|
||||
init<Key: CodingKey>(_ key: Key) {
|
||||
self.stringValue = key.stringValue
|
||||
init<Key: CodingKey>(_ key: Key, keyDecodingStrategy: StructuredFieldDecoder.KeyDecodingStrategy?) {
|
||||
switch keyDecodingStrategy {
|
||||
case .none:
|
||||
self.stringValue = key.stringValue
|
||||
case .some(.lowercase):
|
||||
self.stringValue = key.stringValue.lowercased()
|
||||
default:
|
||||
preconditionFailure("Invalid key decoding strategy")
|
||||
}
|
||||
|
||||
self.intValue = key.intValue
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user