Commit 421a7198 authored by Eero Häkkinen's avatar Eero Häkkinen Committed by Commit Bot

Fix BOM handling in multipart form data fetching

Request and Response's formData() multipart/form-data parsing uses
"UTF-8 decode without BOM" which should not strip BOMs.

Spec issue: https://github.com/whatwg/fetch/issues/650
Spec fix: https://github.com/whatwg/fetch/pull/915
WPT fix: https://github.com/web-platform-tests/wpt/pull/17589

Bug: 796192
Change-Id: I24721899006a8c09cf657b3638f1cb17e7953171
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796367
Commit-Queue: Eero Häkkinen <eero.hakkinen@intel.com>
Reviewed-by: default avatarHiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712496}
parent 01d77ae0
...@@ -399,7 +399,7 @@ class FetchDataLoaderAsFormData final : public FetchDataLoader, ...@@ -399,7 +399,7 @@ class FetchDataLoaderAsFormData final : public FetchDataLoader,
} else { } else {
if (!string_decoder_) { if (!string_decoder_) {
string_decoder_ = std::make_unique<TextResourceDecoder>( string_decoder_ = std::make_unique<TextResourceDecoder>(
TextResourceDecoderOptions::CreateUTF8Decode()); TextResourceDecoderOptions::CreateUTF8DecodeWithoutBOM());
} }
string_builder_.reset(new StringBuilder); string_builder_.reset(new StringBuilder);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment