Skip to content

Concatenating fields inconsistent with docs #94

@0xTim

Description

@0xTim

According the docs setting multiple fields for the same header should append each field in a comma-separated list (unless it's a cookie). However

var headers = HTTPFields()
headers[.date] = "\(Date(timeIntervalSinceReferenceDate: 100.0))"
headers[.date] = "\(Date(timeIntervalSinceReferenceDate: -100.0))"
print(headers)

Only shows the last set date:

[(field: Date: 2000-12-31 23:58:20 +0000, next: 65535)]

Should it not show both dates? If you use headers[values: .date] = [...] it works as expected:

[(field: Date: 2001-01-01 00:01:40 +0000, next: 1), (field: Date: 2000-12-31 23:58:20 +0000, next: 65535)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions