The local loaders assume the url given to them is decoded.

Decode the url before passing down to the local loaders since they do not decode
the url themselves. This was creating a crash on youtube.com since the data url
was percent-encoded and failing to parse from base64.
This commit is contained in:
Patrick Scott
2009-08-13 15:39:20 -04:00
parent a31deaf4a9
commit 68e5300477

View File

@@ -128,6 +128,18 @@ class FrameLoader {
/* package */
static boolean handleLocalFile(String url, LoadListener loadListener,
WebSettings settings) {
// Attempt to decode the percent-encoded url before passing to the
// local loaders.
try {
url = new String(URLUtil.decode(url.getBytes()));
} catch (IllegalArgumentException e) {
loadListener.error(EventHandler.ERROR_BAD_URL,
loadListener.getContext().getString(
com.android.internal.R.string.httpErrorBadUrl));
// Return true here so we do not trigger an unsupported scheme
// error.
return true;
}
if (URLUtil.isAssetUrl(url)) {
FileLoader.requestUrl(url, loadListener, loadListener.getContext(),
true, settings.getAllowFileAccess());