Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1528d8f4 authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

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

parents 25a9ed53 c0bfdb25
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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) {
+2 −1
Original line number Diff line number Diff line
@@ -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);