• Brad Fitzpatrick's avatar
    http: change ResponseWriter.SetHeader(k,v) to Header() accessor · 2c420ece
    Brad Fitzpatrick authored
    Caller code needs to change:
    
    rw.SetHeader("Content-Type", "text/plain")
    to:
    rw.Header().Set("Content-Type", "text/plain")
    
    This now permits returning multiple headers
    with the same name using Add:
    
    rw.Header().Add("Set-Cookie", "..")
    rw.Header().Add("Set-Cookie", "..")
    
    This patch also fixes serialization of headers, removing newline characters.
    
    Fixes #488
    Fixes #914
    
    R=rsc
    CC=gburd, golang-dev
    https://golang.org/cl/4239076
    2c420ece
triv.go 3.48 KB