• Brad Fitzpatrick's avatar
    http: make Headers be source of truth · 6e9b1a78
    Brad Fitzpatrick authored
    Previously Request and Response had redundant fields for
    Referer, UserAgent, and cookies which caused confusion and
    bugs.  It also didn't allow us to expand the package over
    time, since the way to access fields would be in the Headers
    one day and promoted to a field the next day.  That would be
    hard to gofix, especially with code ranging over Headers.
    
    After a discussion on the mail package's design with a similar
    problem, we've designed to make the Headers be the source of
    truth and add accessors instead.
    
    Request:
    change: Referer -> Referer()
    change: UserAgent -> UserAgent()
    change: Cookie -> Cookies()
    new: Cookie(name) *Cookie
    new: AddCookie(*Cookie)
    
    Response:
    change: Cookie -> Cookies()
    
    Cookie:
    new: String() string
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/4620049
    6e9b1a78
Name
Last commit
Last update
..
cmd Loading commit data...
lib9 Loading commit data...
libbio Loading commit data...
libmach Loading commit data...
pkg Loading commit data...
Make.ccmd Loading commit data...
Make.clib Loading commit data...
Make.cmd Loading commit data...
Make.common Loading commit data...
Make.inc Loading commit data...
Make.pkg Loading commit data...
all-qemu.bash Loading commit data...
all.bash Loading commit data...
clean.bash Loading commit data...
env.bash Loading commit data...
make.bash Loading commit data...
quietgcc.bash Loading commit data...
run.bash Loading commit data...
sudo.bash Loading commit data...
version.bash Loading commit data...