; Extracted from RFC 7230

;  Copyright (c) 2014 IETF Trust and the persons identified as the
;  document authors.  All rights reserved.

;  This document is subject to BCP 78 and the IETF Trust's Legal
;  Provisions Relating to IETF Documents
;  (http://trustee.ietf.org/license-info) in effect on the date of
;  publication of this document.  Please review these documents
;  carefully, as they describe your rights and restrictions with respect
;  to this document.  Code Components extracted from this document must
;  include Simplified BSD License text as described in Section 4.e of
;  the Trust Legal Provisions and are provided without warranty as
;  described in the Simplified BSD License.

token          = 1*tchar

tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
               / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
               / DIGIT / ALPHA
               ; any VCHAR, except delimiters

quoted-string  = DQUOTE *( qdtext / quoted-pair ) DQUOTE
qdtext         = HTAB / SP /%x21 / %x23-5B / %x5D-7E / obs-text
obs-text       = %x80-FF

comment        = "(" *( ctext / quoted-pair / comment ) ")"
ctext          = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text

quoted-pair    = "\" ( HTAB / SP / VCHAR / obs-text )

OWS            = *( SP / HTAB )
               ; optional whitespace

RWS            = 1*( SP / HTAB )
               ; required whitespace

BWS            = OWS
               ; "bad" whitespace

header-field   = field-name ":" OWS field-value OWS

field-name     = token
field-value    = *( field-content / obs-fold )
field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]
field-vchar    = VCHAR / obs-text

obs-fold       = CRLF 1*( SP / HTAB )
               ; obsolete line folding
               ; see Section 3.2.4
