diff options
Diffstat (limited to 'WebKit/android')
| -rw-r--r-- | WebKit/android/jni/WebCoreResourceLoader.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/WebKit/android/jni/WebCoreResourceLoader.cpp b/WebKit/android/jni/WebCoreResourceLoader.cpp index cf32c09..297ecb0 100644 --- a/WebKit/android/jni/WebCoreResourceLoader.cpp +++ b/WebKit/android/jni/WebCoreResourceLoader.cpp @@ -253,6 +253,16 @@ jstring WebCoreResourceLoader::RedirectedToUrl(JNIEnv* env, jobject obj, WebCore::ResourceRequest r = handle->request(); WebCore::KURL url(WebCore::KURL(WebCore::ParsedURLString, to_string(env, baseUrl)), to_string(env, redirectTo)); + WebCore::ResourceResponse* response = (WebCore::ResourceResponse*)nativeResponse; + // If the url fails to resolve the relative path, return null. + if (url.protocol().isEmpty()) { + delete response; + return NULL; + } else { + // Ensure the protocol is lowercase. + url.setProtocol(url.protocol().lower()); + } + // Set the url after updating the protocol. r.setURL(url); if (r.httpMethod() == "POST") { r.setHTTPMethod("GET"); @@ -260,12 +270,6 @@ jstring WebCoreResourceLoader::RedirectedToUrl(JNIEnv* env, jobject obj, r.setHTTPBody(0); r.setHTTPContentType(""); } - WebCore::ResourceResponse* response = (WebCore::ResourceResponse*)nativeResponse; - // If the url fails to resolve the relative path, return null. - if (url.protocol().isEmpty()) { - delete response; - return NULL; - } handle->client()->willSendRequest(handle, r, *response); delete response; WebCore::String s = url.string(); |
