[11665] in www-talk@info.cern.ch

home help back first fref pref prev next nref lref last post

RE: Combining multiple message-header fields

daemon@ATHENA.MIT.EDU (Joris Dobbelsteen)
Sat Jul 15 14:19:34 2000

From: "Joris Dobbelsteen" <joris.dobbelsteen@mail.com>
To: "WWW WG (E-mail)" <www-talk@w3.org>
Date: Sat, 15 Jul 2000 20:14:49 +0200
Message-Id: <000f01bfee88$90a2bb10$0d0aa8c0@THUIS.LOCAL>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
In-Reply-To: <005201bfee73$cf618df0$de2190d4@de>
Resent-From: www-talk@w3.org
Content-Transfer-Encoding: quoted-printable

It doesn't matter: You can send

Accept: text/html
Accept: image/*
- or -
Accept: text/html, image/*

If you use a proxy it can be send like this:

User-Agent
 |
 | Accept: text/html
 | Accept: image/*
 |
Proxy
 |
 | Accept: text/html, image/*
 |
Server

What may not hapen is that you make:
Accept: image/*, text/html
The order of the items is changed....

What is most recommended is to combine them in one header, because it sav=
es
(very little, but some) network bandwidth...

 - Joris Dobbelsteen


-----Original Message-----
From: Bjoern Hoehrmann [mailto:derhoermi@gmx.net]
Sent: zaterdag 15 juli 2000 17:45
To: http-wg@cuckoo.hpl.hp.com
Subject: Combining multiple message-header fields


Hi,

RFC2616 says:

| 4.2 Message Headers
| [...]
|    Multiple message-header fields with the same field-name MAY be
|    present in a message if and only if the entire field-value for that
|    header field is defined as a comma-separated list [i.e., #(values)].
|    It MUST be possible to combine the multiple header fields into one
|    "field-name: field-value" pair, without changing the semantics of th=
e
|    message, by appending each subsequent field-value to the first, each
|    separated by a comma. The order in which header fields with the same
|    field-name are received is therefore significant to the
|    interpretation of the combined field value, and thus a proxy MUST NO=
T
|    change the order of these field values when a message is forwarded.

I'm building a HTTP UserAgent with PHP and now i'm dealing with this
multiple
message-header fields. If my UserAgent receives such multiple fields, sho=
uld
it combine these fields into one or should it keep the multiple fields an=
d
send it to the server (if present in a request)? The problem behind this =
is
the storage of this header fields. Currently i have an associative array
that
does something like

Accept =3D> array(text/html, image/*)

if there was

Accept: text/html
Accept: image/*

but when someone wants the value of Accept i only want to return a string
and
therefor i only return the first value i.e. text/html which does not meet
someones expactation.

I appreciate your help,
regards,
  Bj=F6rn H=F6hrmann
--
"Jede  Stra=DFe,  der  man konsequent \ und du wirst ihn in G=E4nze sehen.
bis zu ihrem Ende folgt,  f=FChrt un- ) Stehst Du auf seinem Gipfel wird
weigerlich  ins  Nichts.   Erklimme ( er  f=FCr  Dich  unsichtbar" -- P.
einen  Berg nur ein kleines  St=FCck, \ Irulan <http://bjoernsworld.de/>



home help back first fref pref prev next nref lref last post