summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_script_fetcher_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/proxy/proxy_script_fetcher_impl.cc')
-rw-r--r--net/proxy/proxy_script_fetcher_impl.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/proxy/proxy_script_fetcher_impl.cc b/net/proxy/proxy_script_fetcher_impl.cc
index bc245a2..e840189 100644
--- a/net/proxy/proxy_script_fetcher_impl.cc
+++ b/net/proxy/proxy_script_fetcher_impl.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/string_util.h"
+#include "net/base/data_url.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -123,6 +124,18 @@ int ProxyScriptFetcherImpl::Fetch(const GURL& url,
DCHECK(callback);
DCHECK(text);
+ // Handle base-64 encoded data-urls that contain custom PAC scripts.
+ if (url.SchemeIs("data")) {
+ std::string mime_type;
+ std::string charset;
+ std::string data;
+ if (!DataURL::Parse(url, &mime_type, &charset, &data))
+ return ERR_FAILED;
+
+ ConvertResponseToUTF16(charset, data, text);
+ return OK;
+ }
+
cur_request_.reset(new URLRequest(url, this));
cur_request_->set_context(url_request_context_);
cur_request_->set_method("GET");