rewrite header values, preserving original whitespace where possible.
whitespace
is used to Value.of_string ?whitespace
the ~value
before passing to f
,
and again to Value.to_string ?whitespace
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 ~whitespace:`Strip ~f:(fun ~name:_ ~value -> Value.of_string ~whitespace:`Strip value)
.
By contrast the following will 'normalize' the whitespace on all headers.
map ~whitespace:`Keep ~f:(fun ~name:_ ~value -> Value.of_string ~whitespace:`Strip value)
.