Bug 20018 - Missing Accept field in HTTP request
Summary: Missing Accept field in HTTP request
Status: CLOSED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: 3.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-02-07 15:33 UTC by Alex Likvintsev
Modified: 2002-09-16 14:43 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Likvintsev 2001-02-07 15:26:23 UTC
(*** This bug was imported into bugs.kde.org ***)

Package: konqueror
Version: 3.0 (KDE 2.0.1)
Severity: normal
Compiler: gcc version 2.95.3 19991030 (prerelease)
OS: Linux 2.2.17-21mdk i686 (Linux-Mandrake 7.2)

Konqueror doesn't send "Accept:" header with HTTP request. It results in bad response
from some web-servers. (e.q. ClearQuest asp pages)

Opera send the header:
Accept: text/html image/png image/jpeg image/gif */*

And I get back nice reply.

Thanks
Alex
Comment 1 David Faure 2001-02-08 00:16:38 UTC
On Wednesday 07 February 2001 15:26 Alex Likvintsev wrote:
> Package: konqueror
> Version: 3.0 (KDE 2.0.1)
> Severity: normal
> Compiler: gcc version 2.95.3 19991030 (prerelease)
> OS: Linux 2.2.17-21mdk i686 (Linux-Mandrake 7.2)
> 
> Konqueror doesn't send "Accept:" header with HTTP request. It results in bad response
> from some web-servers. (e.q. ClearQuest asp pages)
> 
> Opera send the header:
> Accept: text/html image/png image/jpeg image/gif */*

And kio_http sends :

Accept: image/x-ico image/gif image/x-xpm image/x-krl image/x-bmp image/x-eps image/png image/tiff image/jpeg image/x-pnm image/fax-g3 image/x-xbm

-- 
David FAURE david@mandrakesoft.com faure@kde.org
http://perso.mandrakesoft.com/~david/ http://www.konqueror.org/
KDE Making The Future of Computing Available Today
Comment 2 Dawit Alemayehu 2001-02-08 17:46:50 UTC
On Thursday 08 February 2001 07:08 David Faure wrote:
> On Thursday 08 February 2001 11:54 you wrote:
> > On 2001.02.08 03:16:38 +0300 David Faure wrote:
> > > On Wednesday 07 February 2001 15:26 Alex Likvintsev wrote:
> > > > Package: konqueror
> > > > Version: 3.0 (KDE 2.0.1)
> > > > Severity: normal
> > > > Compiler: gcc version 2.95.3 19991030 (prerelease)
> > > > OS: Linux 2.2.17-21mdk i686 (Linux-Mandrake 7.2)
> > > >
> > > > Konqueror doesn't send "Accept:" header with HTTP request. It
> > >
> > > results in bad response
> > >
> > > > from some web-servers. (e.q. ClearQuest asp pages)
> > > >
> > > > Opera send the header:
> > > > Accept: text/html image/png image/jpeg image/gif */*
> > >
> > > And kio_http sends :
> > >
> > > Accept: image/x-ico image/gif image/x-xpm image/x-krl image/x-bmp
> > > image/x-eps image/png image/tiff image/jpeg image/x-pnm
> > > image/fax-g3 image/x-xbm
> >
> > Maybe my configuration is wrong somehow?
> > Here are the traces made by Ehtereal0.8.13 .
> > For Konqueror:
> > ***[begin]***
> > GET /cqweb/logon/default.asp HTTP/1.1
> > Connection: Keep-Alive
> > User-Agent: Mozilla/5.0 (compatible; Konqueror/2.0; X11); Supports
> > MD5-Digest; Supports gzip encoding
> > Pragma: no-cache
> > Cache-control: no-cache
> > Accept-Encoding: x-gzip; q=1.0 x-deflate gzip; q=1.0 deflate
> > identity
> > Accept-Charset: KOI8-R;q=1.0 utf-8;q=0.8 *;q=0.9
> > Accept-Language: en ru C
> > Host: discovery.tensquare.com
> > Cookie: ASPSESSIONIDQQGQQRDP=BHGPCNPALDHNIAMDEJJMCLHP
> > ***[end]***
> > - no "Accept" headerand bad responce from server.
>
> Right. Konqueror (khtml) currently sends an Accept header ONLY when
> requesting images. There's not much point in sending it when requesting
> HTML pages I guess.
>
> Does the HTTP spec says that header is mandatory ?

No it is not.  If it is missing it means we accept everything.  But of course there
are broken servers out there ; so we should simply send some defaults.  The one
listed by Opera is fine since at the end it has */* which means everything as well.
Anyways I have added this now.  If the metadata is not set we send that one as a
default.

> It looks quite easy to add it to any request done from khtml in general...
> (but it would need code duplication to send it from minicli (KRun) as
> well unless we go as far as moving the whole thing to kio_http (which
> would then need to initialize KImageIO). I guess that's the reason why the
> accept header is currently sent via metadata ?

Well the meta-data is so that the application can have control over what it wants
to send :)

Regards
Dawit A.