Better handling of forming absolute https URLs, runtime error on https:// access.

Change-Id: I7f6275520b0bd070e645024dd151a8541b8787b2
This commit is contained in:
Andreas Huber
2010-12-21 14:36:19 -08:00
parent b057c3dbe6
commit c0bfdb257c
2 changed files with 4 additions and 3 deletions

View File

@@ -179,9 +179,9 @@ status_t LiveSession::fetchFile(const char *url, sp<ABuffer> *out) {
if (!strncasecmp(url, "file://", 7)) {
source = new FileSource(url + 7);
} else if (strncasecmp(url, "http://", 7)) {
return ERROR_UNSUPPORTED;
} else {
CHECK(!strncasecmp(url, "http://", 7));
status_t err = mHTTPDataSource->connect(url);
if (err != OK) {

View File

@@ -84,12 +84,13 @@ static bool MakeURL(const char *baseURL, const char *url, AString *out) {
out->clear();
if (strncasecmp("http://", baseURL, 7)
&& strncasecmp("https://", baseURL, 8)
&& strncasecmp("file://", baseURL, 7)) {
// Base URL must be absolute
return false;
}
if (!strncasecmp("http://", url, 7)) {
if (!strncasecmp("http://", url, 7) || !strncasecmp("https://", url, 8)) {
// "url" is already an absolute URL, ignore base URL.
out->setTo(url);