Skip to content

Concatenating fields inconsistent with docs #94

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)]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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