Hi, Stipe.

Stipe Tolj wrote:

Vjacheslav Chekushin wrote:

Hi, list.
Writing http_header_pack function I get strange behavour for
some web sites.

1)
GET /img/eslogo0P.wbmp HTTP/1.1
Host: wap.eurosport.com
Accept: text/html
Accept: image/vnd.wap.wbmp

Works.

2)
GET /img/eslogo0P.wbmp HTTP/1.1
Host: wap.eurosport.com
Accept: text/html, image/vnd.wap.wbmp

Works.

3)
GET /img/eslogo0P.wbmp HTTP/1.1
Host: wap.eurosport.com
Accept: text/html,
 image/vnd.wap.wbmp

HTTP/1.1 406 No acceptable objects were found
Server: Microsoft-IIS/5.0
--skipped--

As I undestand from HTTP specification all 3 requests are completly
equivalent. And my http_header_pack realization make 1->3
translation.
So question is: do I misundestand specifications or something else?

Are you sure that case 3 is a valid HTTP header?!

AFAIK, each HTTP header entity must be a single line ended by a
newline. Case 3 would break this ruleset.

RFC 2616
Hypertext Transfer Protocol -- HTTP/1.1

4.2 Message Headers

   HTTP header fields, which include general-header (section 4.5),
   request-header (section 5.3), response-header (section 6.2), and
   entity-header (section 7.1) fields, follow the same generic format as
   that given in Section 3.1 of RFC 822 [9]. Each header field consists
   of a name followed by a colon (":") and the field value. Field names
   are case-insensitive. The field value MAY be preceded by any amount
   of LWS, though a single SP is preferred.
(!) Header fields can be
   extended over multiple lines by preceding each extra line with at
   least one SP or HT.

And more, from RFC 822
3.1.1.  LONG HEADER FIELDS

        Each header field can be viewed as a single, logical  line  of
        ASCII  characters,  comprising  a field-name and a field-body.
        For convenience, the field-body  portion  of  this  conceptual
        entity  can be split into a multiple-line representation; this
        is called "folding".  The general rule is that wherever  there
        may  be  linear-white-space  (NOT  simply  LWSP-chars), a CRLF
        immediately followed by AT LEAST one LWSP-char may instead  be
        inserted.  Thus, the single line
            To:  "Joe & J. Harvey" <ddd @Org>, JJV @ BBN
        can be represented as:
            To:  "Joe & J. Harvey" <ddd @ Org>,
                    JJV@BBN

So I think case 3 must not break specification. Do I miss something?


Stipe

[EMAIL PROTECTED]
-------------------------------------------------------------------
Wapme Systems AG


--
Vjacheslav Chekushin                                mailto:[EMAIL PROTECTED]
Latvian Mobile Phone Company                        http://www.lmt.lv


Reply via email to