mirror of
https://github.com/apple/swift-http-types
synced 2026-11-28 05:14:20 +00:00
Values -> fields
This commit is contained in:
1 parent
2d2eb2942b
commit
e716d5d2bc
1 file changed
+3
-3
@@ -172,10 +172,10 @@ public struct HTTPFields: Sendable, Hashable {
|
||||
/// semicolon.
|
||||
public subscript(name: HTTPField.Name) -> String? {
|
||||
get {
|
||||
let values = self.fields(for: name)
|
||||
if values.first(where: { _ in true }) != nil {
|
||||
let fields = self.fields(for: name)
|
||||
if fields.first(where: { _ in true }) != nil {
|
||||
let separator = name == .cookie ? "; " : ", "
|
||||
return values.lazy.map(\.value).joined(separator: separator)
|
||||
return fields.lazy.map(\.value).joined(separator: separator)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user