summaryrefslogtreecommitdiffstats
path: root/net/base/mime_sniffer.cc
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-17 21:43:20 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-17 21:43:20 +0000
commit8ef59c3b8d485227dae56a1ce4edc784be329f59 (patch)
tree68344d77979b8a468e5d2c95e3798b87adfd836d /net/base/mime_sniffer.cc
parent4a324a1705813d626833e38539f3cc3bf27b2627 (diff)
downloadchromium_src-8ef59c3b8d485227dae56a1ce4edc784be329f59.zip
chromium_src-8ef59c3b8d485227dae56a1ce4edc784be329f59.tar.gz
chromium_src-8ef59c3b8d485227dae56a1ce4edc784be329f59.tar.bz2
Fix problem where "text/xml" responses get buffered past 512 bytes, causing the response to be truncated.
BUG=3521 Review URL: http://codereview.chromium.org/7610 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3567 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/mime_sniffer.cc')
-rw-r--r--net/base/mime_sniffer.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/base/mime_sniffer.cc b/net/base/mime_sniffer.cc
index 53e765e..da117e2 100644
--- a/net/base/mime_sniffer.cc
+++ b/net/base/mime_sniffer.cc
@@ -529,7 +529,9 @@ bool SniffMimeType(const char* content, size_t content_size,
// We're not interested in sniffing these types for images and the like.
// Instead, we're looking explicitly for a feed. If we don't find one we're
// done and return early.
- return SniffXML(content, content_size, result);
+ if (SniffXML(content, content_size, result))
+ return true;
+ return content_size >= kMaxBytesToSniff;
}
// Now we look in our large table of magic numbers to see if we can find