Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3960)

Unified Diff: chrome/browser/renderer_host/buffered_resource_handler.cc

Issue 194044: Merge 25608 - Refuse to render RSS as XML by treating the response as text/pl... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/buffered_resource_handler.cc
===================================================================
--- chrome/browser/renderer_host/buffered_resource_handler.cc (revision 25656)
+++ chrome/browser/renderer_host/buffered_resource_handler.cc (working copy)
@@ -158,6 +158,19 @@
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
Property changes on: chrome\browser\renderer_host\buffered_resource_handler.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/renderer_host/buffered_resource_handler.cc:r25608
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698