Bug 65391 - [Qt] Send Basic authentication headers when URL explicitly provides one
Summary: [Qt] Send Basic authentication headers when URL explicitly provides one
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Siddharth Mathur
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2011-07-29 14:18 PDT by Siddharth Mathur
Modified: 2014-02-03 03:18 PST (History)
5 users (show)

See Also:


Attachments
Patch (3.67 KB, patch)
2011-07-29 14:34 PDT, Siddharth Mathur
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Siddharth Mathur 2011-07-29 14:18:15 PDT
When a URL of type http://username:password@server.com/file.html is requested, QtWebKit could presumptively supply the credentials via the Basic authentication mechanism of appending the "Authorization" HTTP header.
Comment 1 Siddharth Mathur 2011-07-29 14:34:46 PDT
Created attachment 102398 [details]
Patch

The following two tests pass with this patch, and may be un-skipped: 
http/tests/xmlhttprequest/basic-auth-nouser.html
http/tests/xmlhttprequest/basic-auth.html

No improvements/regressions in http/tests/loading/
Comment 2 Robert Hogan 2011-07-29 15:33:47 PDT
Did you test this against Qt trunk? And does it affect the tests due to be unskipped with Qt 4.8 when you do? Otherwise it seems like a good idea to me.
Comment 3 Andreas Kling 2011-08-01 00:19:47 PDT
Does this belong in QtWebKit or QNAM? (I can't really tell.) :)
Comment 4 Peter Hartmann 2011-08-01 01:27:59 PDT
(In reply to comment #3)
> Does this belong in QtWebKit or QNAM? (I can't really tell.) :)

I think it should ultimately go into QNAM, as proposed in https://bugreports.qt.nokia.com//browse/QTBUG-18107 , but maybe you want to put it into webkit until it has been fixed in QNAM...
Comment 5 Siddharth Mathur 2011-08-01 08:44:27 PDT
(In reply to comment #2)
> Did you test this against Qt trunk? And does it affect the tests due to be unskipped with Qt 4.8 when you do? Otherwise it seems like a good idea to me.

With Qt 4.8 beta snapshot, this patch appears to have no impact for the tests you refer to in the Skipped list: 
- xmlhttprequest/re-login-async.html continues to pass
- xmlhttprequest/re-login.html continues to fail with (PASS, FAIL, PASS, FAIL) in the subtests. 

PS: It's odd that the file mentioned here for your MR has no code modified by the patch: 
http://www.qt.gitorious.org/qt/staging/commit/fdcb3fe188cca00b1d7f1eae82304d8cca549996?diffmode=sidebyside
Comment 6 Siddharth Mathur 2011-08-01 09:18:14 PDT
> PS: It's odd that the file mentioned here for your MR has no code modified by the patch: 
> http://www.qt.gitorious.org/qt/staging/commit/fdcb3fe188cca00b1d7f1eae82304d8cca549996?diffmode=sidebyside

Sorry, about this confusing comment. Robert's MR *is* part of Qt 4.8 beta snapshot. re-login-async.html passes with Qt 4.8, but not xmlhttprequest/re-login.html
Comment 7 Alexis Menard (darktears) 2011-08-01 10:24:50 PDT
(In reply to comment #6)
> > PS: It's odd that the file mentioned here for your MR has no code modified by the patch: 
> > http://www.qt.gitorious.org/qt/staging/commit/fdcb3fe188cca00b1d7f1eae82304d8cca549996?diffmode=sidebyside
> 
> Sorry, about this confusing comment. Robert's MR *is* part of Qt 4.8 beta snapshot. re-login-async.html passes with Qt 4.8, but not xmlhttprequest/re-login.html

why?
Comment 8 Siddharth Mathur 2011-08-02 06:43:38 PDT
> > Sorry, about this confusing comment. Robert's MR *is* part of Qt 4.8 beta snapshot. re-login-async.html passes with Qt 4.8, but not xmlhttprequest/re-login.html
> 
> why?

Robert is perhaps the better person to investigate that. 

As far as the patch presented here is concerned, it's not causing any regressions in my tests with http/tests/xmlhttprequest/ and  http/tests/loading/
Comment 9 Siddharth Mathur 2011-08-09 06:31:37 PDT
Peter,

Could you please re-open QTBUG-18107? The test case which Carlos seeks is simply : 
 aQNAM->get(QUrl("http://username:password@server.com/file.html"));

As the workaround proposed in this patch needs to be done in MediaPlayerPrivateQt too, it would desirable to not workaround QTBUG-18107 at two places in QtWebKit. 

QTBUG-18107 blocks a very basic use case. 

Thanks,
Siddharth
Comment 10 Peter Hartmann 2011-08-10 02:43:05 PDT
(In reply to comment #9)
> Peter,
> 
> Could you please re-open QTBUG-18107? The test case which Carlos seeks is simply : 
>  aQNAM->get(QUrl("http://username:password@server.com/file.html"));

ok, reopened the task.
Comment 11 Jocelyn Turcotte 2014-02-03 03:18:27 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.