Changeset 74609 in webkit


Ignore:
Timestamp:
Dec 23, 2010 8:06:26 PM (13 years ago)
Author:
ariya@webkit.org
Message:

[Qt] User name/password stripped from URLs
https://bugs.webkit.org/show_bug.cgi?id=36232

Patch by Jan Erik Hanssen <jhanssen@sencha.com> on 2010-12-23
Reviewed by Adam Barth.

WebCore:

If a username but no password or no username but a password is present
in a URL, QtWebKit won't send any authentication information down to Qt
as it should.

Tests: http/tests/xmlhttprequest/basic-auth-nopassword.html

http/tests/xmlhttprequest/basic-auth-nouser.html

  • platform/network/qt/ResourceHandleQt.cpp:

(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::loadResourceSynchronously):

LayoutTests:

Test authentication cases where a username but no password and
no username but a password is present.

  • http/tests/xmlhttprequest/basic-auth-nopassword-expected.txt: Added.
  • http/tests/xmlhttprequest/basic-auth-nopassword.html: Added.
  • http/tests/xmlhttprequest/basic-auth-nouser-expected.txt: Added.
  • http/tests/xmlhttprequest/basic-auth-nouser.html: Added.
  • http/tests/xmlhttprequest/resources/basic-auth-nouserpass/basic-auth-nouserpass.php: Added.
  • platform/gtk/Skipped:
  • platform/mac-leopard/http/tests/xmlhttprequest/basic-auth-nopassword-expected.txt: Added.
  • platform/mac-snowleopard/http/tests/xmlhttprequest/basic-auth-nopassword-expected.txt: Added.
  • platform/mac-tiger/http/tests/xmlhttprequest/basic-auth-nopassword-expected.txt: Added.
  • platform/qt/Skipped:
Location:
trunk
Files:
13 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r74608 r74609  
     12010-12-23  Jan Erik Hanssen  <jhanssen@sencha.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        [Qt] User name/password stripped from URLs
     6        https://bugs.webkit.org/show_bug.cgi?id=36232
     7
     8        Test authentication cases where a username but no password and
     9        no username but a password is present.
     10
     11        * http/tests/xmlhttprequest/basic-auth-nopassword-expected.txt: Added.
     12        * http/tests/xmlhttprequest/basic-auth-nopassword.html: Added.
     13        * http/tests/xmlhttprequest/basic-auth-nouser-expected.txt: Added.
     14        * http/tests/xmlhttprequest/basic-auth-nouser.html: Added.
     15        * http/tests/xmlhttprequest/resources/basic-auth-nouserpass/basic-auth-nouserpass.php: Added.
     16        * platform/gtk/Skipped:
     17        * platform/mac-leopard/http/tests/xmlhttprequest/basic-auth-nopassword-expected.txt: Added.
     18        * platform/mac-snowleopard/http/tests/xmlhttprequest/basic-auth-nopassword-expected.txt: Added.
     19        * platform/mac-tiger/http/tests/xmlhttprequest/basic-auth-nopassword-expected.txt: Added.
     20        * platform/qt/Skipped:
     21
    1222010-12-23  Ryosuke Niwa  <rniwa@webkit.org>
    223
  • trunk/LayoutTests/platform/gtk/Skipped

    r74605 r74609  
    55865586# https://bugs.webkit.org/show_bug.cgi?id=51380
    55875587http/tests/inspector/console-websocket-error.html
     5588
     5589# Passing just a username or just a password to
     5590# layoutTestController.queueLoad() does not work
     5591http/tests/xmlhttprequest/basic-auth-nouser.html
     5592http/tests/xmlhttprequest/basic-auth-password.html
  • trunk/LayoutTests/platform/qt/Skipped

    r74486 r74609  
    275275editing/inserting/5994480-2.html
    276276editing/inserting/insert-bg-font.html
     277
     278# http://bugreports.qt.nokia.com/browse/QTBUG-15566
     279http/tests/xmlhttprequest/basic-auth-nouser.html
    277280
    278281# =========================================================================== #
  • trunk/WebCore/ChangeLog

    r74603 r74609  
     12010-12-23  Jan Erik Hanssen  <jhanssen@sencha.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        [Qt] User name/password stripped from URLs
     6        https://bugs.webkit.org/show_bug.cgi?id=36232
     7
     8        If a username but no password or no username but a password is present
     9        in a URL, QtWebKit won't send any authentication information down to Qt
     10        as it should.
     11
     12        Tests: http/tests/xmlhttprequest/basic-auth-nopassword.html
     13               http/tests/xmlhttprequest/basic-auth-nouser.html
     14
     15        * platform/network/qt/ResourceHandleQt.cpp:
     16        (WebCore::ResourceHandle::start):
     17        (WebCore::ResourceHandle::loadResourceSynchronously):
     18
    1192010-12-23  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/WebCore/platform/network/qt/ResourceHandleQt.cpp

    r73710 r74609  
    125125        return false;
    126126
    127     if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) {
     127    if (!d->m_user.isEmpty() || !d->m_pass.isEmpty()) {
    128128        // If credentials were specified for this request, add them to the url,
    129129        // so that they will be passed to QNetworkRequest.
     
    187187
    188188    ResourceHandleInternal* d = handle->getInternal();
    189     if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) {
     189    if (!d->m_user.isEmpty() || !d->m_pass.isEmpty()) {
    190190        // If credentials were specified for this request, add them to the url,
    191191        // so that they will be passed to QNetworkRequest.
Note: See TracChangeset for help on using the changeset viewer.