Skip to content

Http server doesn't support writing multiple headers with the same name #488

@hoisie

Description

@hoisie
conn.SetHeader(name,val) by default overrides any previous value under the
same name. 

This makes it very difficult to write multiple Set-Cookie headers, for
instance. 

Headers with the same name are quite common for http servers. Just query
google.com and you'll see an example (the two Set-Cookie headers). 


mhoisie@Kenna gotest $ telnet google.com 80
Trying 74.125.19.106...
Connected to google.com.
Escape character is '^]'.
GET / HTTP/1.1

HTTP/1.1 200 OK
Date: Sat, 02 Jan 2010 17:21:48 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie:
PREF=ID=c87cc887bc1adb8c:TM=1262452908:LM=1262452908:S=UkIVKQcywQeWefwp;
expires=Mon, 02-Jan-2012 17:21:48 GMT; path=/; domain=.google.com
Set-Cookie:
NID=30=ulQicanZo3Kkybu2XhzSJSPxzgqWseouLX8fCcqxnFy6n7A90LE_nFx0PE2ihD5Z9_bCMZZqy8XG-bP_OenKaMtS9AqQY6_0bn_5Oc2LCtbj7Oik9cLqaTre-Hwprlpc;
expires=Sun, 04-Jul-2010 17:21:48 GMT; path=/; domain=.google.com; HttpOnly
Server: gws
X-XSS-Protection: 0
Transfer-Encoding: chunked

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions