Skip to content
Permalink
Browse files

Fix documenation in HTTPHeaders. (#1335)

Motivation:

`subscript(name:)` and `first(name:)` incorrectly referred users to
`getCanonicalForm` for a maximally decomposed list of header fields.
This no longer exists.

Modifications:

Point users to `subscript(canonicalForm:)`.

Result:

More accurate documenation.
  • Loading branch information
glbrntt authored and weissi committed Jan 11, 2020
1 parent ea5a649 commit f44fe0b2042924e3f0392febd8716bbcfc8f36a6
Showing with 2 additions and 2 deletions.
  1. +2 −2 Sources/NIOHTTP1/HTTPTypes.swift
@@ -407,7 +407,7 @@ public struct HTTPHeaders: CustomStringConvertible, ExpressibleByDictionaryLiter
/// returns them in their original representation: that means that a comma-separated
/// header field list may contain more than one entry, some of which contain commas
/// and some do not. If you want a representation of the header fields suitable for
/// performing computation on, consider `getCanonicalForm`.
/// performing computation on, consider `subscript(canonicalForm:)`.
///
/// - Parameter name: The header field name whose values are to be retrieved.
/// - Returns: A list of the values for that header field name.
@@ -427,7 +427,7 @@ public struct HTTPHeaders: CustomStringConvertible, ExpressibleByDictionaryLiter
/// but instead returns the first value from the original representation: that means
/// that a comma-separated header field list may contain more than one entry, some of
/// which contain commas and some do not. If you want a representation of the header fields
/// suitable for performing computation on, consider `getCanonicalForm`.
/// suitable for performing computation on, consider `subscript(canonicalForm:)`.
///
/// - Parameter name: The header field name whose first value should be retrieved.
/// - Returns: The first value for the header field name.

0 comments on commit f44fe0b

Please sign in to comment.
You can’t perform that action at this time.