Chromium Code Reviews| Index: extensions/browser/api/mime_handler_private/mime_handler_private.cc |
| diff --git a/extensions/browser/api/mime_handler_private/mime_handler_private.cc b/extensions/browser/api/mime_handler_private/mime_handler_private.cc |
| index b7d557d18015285cb3bb90a542fb863dfdf0bfaa..1824b4e3eb10c68c71f37fc4c9bb52a46b683be3 100644 |
| --- a/extensions/browser/api/mime_handler_private/mime_handler_private.cc |
| +++ b/extensions/browser/api/mime_handler_private/mime_handler_private.cc |
| @@ -4,6 +4,7 @@ |
| #include "extensions/browser/api/mime_handler_private/mime_handler_private.h" |
| +#include "base/strings/string_util.h" |
| #include "content/public/browser/stream_handle.h" |
| #include "content/public/browser/stream_info.h" |
| #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h" |
| @@ -24,6 +25,12 @@ mojo::Map<mojo::String, mojo::String> CreateResponseHeadersMap( |
| std::string header_name; |
| std::string header_value; |
| while (headers->EnumerateHeaderLines(&iter, &header_name, &header_value)) { |
| + // mojo strings must be UTF-8 and headers might not be, so drop any headers |
| + // that aren't ASCII. The PDF plugin does not use any headers with non-ASCII |
| + // names and non-ASCII values are never useful for the headers the plugin |
| + // does use. |
|
raymes
2015/04/21 01:00:07
What would be the correct fix? Should we file a bu
Sam McNally
2015/04/21 03:18:55
Added a TODO and mentioned it in the mojom and idl
|
| + if (!base::IsStringASCII(header_name) || !base::IsStringASCII(header_value)) |
| + continue; |
| auto& current_value = result[header_name]; |
| if (!current_value.empty()) |
| current_value += ", "; |