Changeset 211407 in webkit


Ignore:
Timestamp:
Jan 30, 2017 10:27:37 PM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] HTTP authentication is not implemented for downloads
https://bugs.webkit.org/show_bug.cgi?id=167583

Reviewed by Michael Catanzaro.

When a normal load is converted to a download, the HTTP authentication happens before the load is converted, and
the download starts already authenticated. However, downloads started by DownloadManager::startDownload use the
DownloadClient API to do the authentication. We don't implement didReceiveAuthenticationChallenge() in our
download client, what makes the load to be cancelled and then fail silently. We should probably add API to
handle downloads authentication, but we can also forward the authentication to the web view for downloads having
a web view associated. That would cover most of the cases, like downloading from the context menu.

  • UIProcess/API/gtk/WebKitDownloadClient.cpp: Add didReceiveAuthenticationChallenge implementation.
Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r211403 r211407  
     12017-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] HTTP authentication is not implemented for downloads
     4        https://bugs.webkit.org/show_bug.cgi?id=167583
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        When a normal load is converted to a download, the HTTP authentication happens before the load is converted, and
     9        the download starts already authenticated. However, downloads started by DownloadManager::startDownload use the
     10        DownloadClient API to do the authentication. We don't implement didReceiveAuthenticationChallenge() in our
     11        download client, what makes the load to be cancelled and then fail silently. We should probably add API to
     12        handle downloads authentication, but we can also forward the authentication to the web view for downloads having
     13        a web view associated. That would cover most of the cases, like downloading from the context menu.
     14
     15        * UIProcess/API/gtk/WebKitDownloadClient.cpp: Add didReceiveAuthenticationChallenge implementation.
     16
    1172017-01-30  Sam Weinig  <sam@webkit.org>
    218
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.cpp

    r207404 r211407  
    2525#include "WebKitURIResponsePrivate.h"
    2626#include "WebKitWebContextPrivate.h"
     27#include "WebKitWebViewPrivate.h"
    2728#include "WebProcessPool.h"
    2829#include <WebKit/WKString.h>
     
    4546        GRefPtr<WebKitDownload> download = webkitWebContextGetOrCreateDownload(downloadProxy);
    4647        webkitWebContextDownloadStarted(m_webContext, download.get());
     48    }
     49
     50    void didReceiveAuthenticationChallenge(WebProcessPool*, DownloadProxy* downloadProxy, AuthenticationChallengeProxy* authenticationChallenge) override
     51    {
     52        GRefPtr<WebKitDownload> download = webkitWebContextGetOrCreateDownload(downloadProxy);
     53        if (webkitDownloadIsCancelled(download.get()))
     54            return;
     55
     56        // FIXME: Add API to handle authentication of downloads without a web view associted.
     57        if (auto* webView = webkit_download_get_web_view(download.get()))
     58            webkitWebViewHandleAuthenticationChallenge(webView, authenticationChallenge);
    4759    }
    4860
Note: See TracChangeset for help on using the changeset viewer.