Commit bb84d169 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

Correctly serialize empty content_type for blobs.

A BlobDataHandle could not have a content_type set, but that should be
treated no different from an empty string, so serialize it as such.
Otherwise this will trigger validation failures causing weird behavior
when for example a blob without a content type is posted on a
MessagePort.

Bug: 813146
Change-Id: I0a20a6b91391e9aa490a337b93c74f9ab4316e31
Reviewed-on: https://chromium-review.googlesource.com/924338
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537462}
parent 384fe0f5
...@@ -23,7 +23,7 @@ struct PLATFORM_EXPORT ...@@ -23,7 +23,7 @@ struct PLATFORM_EXPORT
static WTF::String content_type( static WTF::String content_type(
const scoped_refptr<blink::BlobDataHandle>& input) { const scoped_refptr<blink::BlobDataHandle>& input) {
return input->GetType(); return input->GetType().IsNull() ? g_empty_string : input->GetType();
} }
static uint64_t size(const scoped_refptr<blink::BlobDataHandle>& input) { static uint64_t size(const scoped_refptr<blink::BlobDataHandle>& input) {
......
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