Bug 205088 - When accessing a password-protected site, Konqueror mis-identifies content as text/html, even if it isn't
Summary: When accessing a password-protected site, Konqueror mis-identifies content as...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: http (other bugs)
Version First Reported In: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 191770 210962 214639 215119 216995 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-25 15:41 UTC by Alain Knaff
Modified: 2010-02-02 20:08 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alain Knaff 2009-08-25 15:41:51 UTC
Version:           4.3.00 (KDE 4.3.0) (using 4.3.00 (KDE 4.3.0), 4.3.0-0.1.fc11 Fedora)
Compiler:          gcc
OS:                Linux (i686) release 2.6.29.6-217.2.8.fc11.i586

When accessing a password-protected site, web servers such as Apache, return a Mime-Type of text/html in the "401 Authorization Required" response. This makes sense, as the explanatory text about the error is indeed html. The second request (which includes the password) then gets a response with the correct mime type (which may be something else, such as text/plain)

Konqueror seems to become confused by this, and incorrectly uses the Mime Type from that first reply, and applies it to the contents of the second reply, displaying any plaintext documents on a password-protected site as html.

Test Case:

http://alain.knaff.lu/bug-reports/kde/mime-type/plain.txt

Username is kde, password is kde.

Same thing, not requiring a password (everything is configured the same, except that second site does not require password):

http://alain.knaff.lu/bug-reports/kde/mime-type-nopass/plain.txt
Comment 1 Tommi Tervo 2009-11-15 14:46:57 UTC
*** Bug 214639 has been marked as a duplicate of this bug. ***
Comment 2 Tommi Tervo 2009-11-15 14:47:27 UTC
*** Bug 210962 has been marked as a duplicate of this bug. ***
Comment 3 Tommi Tervo 2009-11-15 14:53:43 UTC
not sure if this is dupe of #191770.
Comment 4 Tommi Tervo 2009-11-18 21:15:33 UTC
*** Bug 215119 has been marked as a duplicate of this bug. ***
Comment 5 Maksim Orlovich 2009-12-02 00:55:18 UTC
*** Bug 191770 has been marked as a duplicate of this bug. ***
Comment 6 Maksim Orlovich 2009-12-02 00:55:28 UTC
*** Bug 216995 has been marked as a duplicate of this bug. ***
Comment 7 Andreas Pietzowski 2009-12-02 01:33:48 UTC
Another test case for a PDF content-type with htaccess protection:

http://www.pietzowski.de/pdf/   (optional append index.php)
User: user
Pass: pass

Please fix this or vote for fixing soon :)
Comment 8 Dawit Alemayehu 2009-12-11 23:26:33 UTC
SVN commit 1061509 by adawit:

- Whenever a server responds with a 401/407 status code, defer mimeType notification 
  until the actual content is obtained. 

BUG:205088


 M  +3 -1      http.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1061509
Comment 9 Turtle 2010-02-02 20:08:24 UTC
(In reply to comment #7)
> Another test case for a PDF content-type with htaccess protection:
> 
> http://www.pietzowski.de/pdf/   (optional append index.php)
> User: user
> Pass: pass
> 
> Please fix this or vote for fixing soon :)

When I go to this site I still get this bug for the pdf mime/type but not the text one above. Is this not fixed for PDF?