diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-07 23:09:58 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-07 23:09:58 +0000 |
commit | b4599a15c90a853930187cc751c951beb819c02d (patch) | |
tree | c23fa0bf4f5399d0df1fd68f7c39fed03a63a19b /chrome/browser/renderer_host/buffered_resource_handler.cc | |
parent | cf2ce2306a89387b1708eea172b2497e701a5bd8 (diff) | |
download | chromium_src-b4599a15c90a853930187cc751c951beb819c02d.zip chromium_src-b4599a15c90a853930187cc751c951beb819c02d.tar.gz chromium_src-b4599a15c90a853930187cc751c951beb819c02d.tar.bz2 |
Refuse to render RSS as XML by treating the response as text/plain. This is
somewhat unfortunate, but we need to do this until we have a built-in feed
previewer.
R=mal
BUG=21238
Review URL: http://codereview.chromium.org/201044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25608 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/buffered_resource_handler.cc')
-rw-r--r-- | chrome/browser/renderer_host/buffered_resource_handler.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/buffered_resource_handler.cc b/chrome/browser/renderer_host/buffered_resource_handler.cc index cba1754..53e78097 100644 --- a/chrome/browser/renderer_host/buffered_resource_handler.cc +++ b/chrome/browser/renderer_host/buffered_resource_handler.cc @@ -178,6 +178,19 @@ bool BufferedResourceHandler::DelayResponse() { response_->response_head.mime_type.assign(mime_type); } + if (mime_type == "application/rss+xml" || + mime_type == "application/atom+xml") { + // Sad face. The server told us that they wanted us to treat the response + // as RSS or Atom. Unfortunately, we don't have a built-in feed previewer + // like other browsers. We can't just render the content as XML because + // web sites let third parties inject arbitrary script into their RSS + // feeds. That leaves us with little choice but to practically ignore the + // response. In the future, when we have an RSS feed previewer, we can + // remove this logic. + mime_type.assign("text/plain"); + response_->response_head.mime_type.assign(mime_type); + } + if (ShouldBuffer(request_->url(), mime_type)) { // This is a temporary fix for the fact that webkit expects to have // enough data to decode the doctype in order to select the rendering |