[XHR] Do not replace request content-type "utf-8" charset

The spec asks us to replace the charset to "UTF-8" only when it is not
equal to "UTF-8" case insensitively.

https://xhr.spec.whatwg.org/#the-send()-method

"""
Otherwise, if the header whose name is a byte-case-insensitive match for
`Content-Type` in author request headers has a value that is a valid
MIME type, which has a `charset` parameter whose value is not a
byte-case-insensitive match for encoding, and encoding is not null, then
set all the `charset` parameters whose value is not a
byte-case-insensitive match for encoding of that header’s value to
encoding.
"""

The new behavior is aligned with Firefox:
https://wpt.fyi/XMLHttpRequest/send-content-type-charset.htm

Bug: 651750
Change-Id: Iff716e5ceece20e60bf8e69a73a980a4ea4fc6b9
Reviewed-on: https://chromium-review.googlesource.com/773942
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org>
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518203}
2 files changed