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

Commit a401d559 authored by Kristian Monsen's avatar Kristian Monsen
Browse files

Don't cut the url on a redirect

This is a fix for issue 2485033. It is not a final fix, but just starting with this so it can be discussed on code review. The line in question
was added to fix issue 1690652.

Updated fix. Stores the url before it is cut during a redirect. Forwards this to the reponse instead of the cut url.

Update 2: Using the old originalUrl

Change-Id: I286084451aa45e51d5d07811f9d119cf83849592
parent a69f5403
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1057,7 +1057,7 @@ class LoadListener extends Handler implements EventHandler {
                mCacheLoader != null) ? HTTP_OK : mStatusCode;
        // pass content-type content-length and content-encoding
        final int nativeResponse = nativeCreateResponse(
                mUrl, statusCode, mStatusText,
                originalUrl(), statusCode, mStatusText,
                mMimeType, mContentLength, mEncoding);
        if (mHeaders != null) {
            mHeaders.getHeaders(new Headers.HeaderCallback() {
@@ -1256,9 +1256,6 @@ class LoadListener extends Handler implements EventHandler {
                return;
            }

            if (mOriginalUrl == null) {
                mOriginalUrl = mUrl;
            }

            // Cache the redirect response
            if (getErrorID() == OK) {
@@ -1273,6 +1270,8 @@ class LoadListener extends Handler implements EventHandler {
                        WebViewWorker.MSG_REMOVE_CACHE, this).sendToTarget();
            }

            // Saving a copy of the unstripped url for the response
            mOriginalUrl = redirectTo;
            // This will strip the anchor
            setUrl(redirectTo);