diff options
author | Patrick Scott <phanna@android.com> | 2010-03-31 13:34:16 -0400 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2010-03-31 13:34:16 -0400 |
commit | 7e3fd47a03f285495dea397b4e96573bd907e189 (patch) | |
tree | ad5dbf52519a99995a5e408016fbbe52bf5ab45f | |
parent | 1dd519bd5e9b805a25b9c57fd56ff0d39388f59a (diff) | |
download | external_webkit-7e3fd47a03f285495dea397b4e96573bd907e189.zip external_webkit-7e3fd47a03f285495dea397b4e96573bd907e189.tar.gz external_webkit-7e3fd47a03f285495dea397b4e96573bd907e189.tar.bz2 |
Make sure the protocol is lower case in the redirect.
Bug: 2560217
Change-Id: I22a7c854a4e043682eac8b92ca2dece256af76b8
-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(); |