package email_message
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=3aa5c85da8530c277cf9e72e18861b235b3b872f08c87f118c04478433320ebb
doc/email_message.kernel/Email_message_kernel/Headers/index.html
Module Email_message_kernel.Headers
Source
Normalize
specifies how to handle header values. It is used in two contexts:
This is just a list of commonly used header field names for simple reuse
eol
defaults to `LF
If headers with this name already exist, concatenates the values for all separated by a comma, and appends the new value. Otherwise, creates a new header.
val map :
?normalize:Normalize.decode ->
t ->
f:(name:Name.t -> value:Value.t -> Value.t) ->
t
rewrite header values, preserving original whitespace where possible.
normalize
is used to Value.of_string ?normalize
the ~value
before passing to f
, and again to Value.to_string ?normalize
the result. If the ~value
and f ~name ~value
are the same no change will be made (white space is preserved).
Particularly the following is an identity transform: map ~normalize:`Whitespace ~f:(fun ~name:_ ~value -> Value.of_string ~normalize:`Whitespace value)
. By contrast the following will 'normalize' the whitespace on all headers. map ~normalize:`None ~f:(fun ~name:_ ~value -> Value.of_string ~normalize:`Whitespace value)
.