Descriptionhttp: make Headers be source of truth
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
Patch Set 1 #Patch Set 2 : diff -r d086bab9b037 https://go.googlecode.com/hg #
Total comments: 2
Patch Set 3 : diff -r d086bab9b037 https://go.googlecode.com/hg #
Total comments: 8
Patch Set 4 : diff -r bd35e21c471e https://go.googlecode.com/hg #Patch Set 5 : diff -r f5d2325ee229 https://go.googlecode.com/hg/ #
Total comments: 1
Patch Set 6 : diff -r f5d2325ee229 https://go.googlecode.com/hg/ #Patch Set 7 : diff -r f5d2325ee229 https://go.googlecode.com/hg #
Total comments: 3
Patch Set 8 : diff -r f5d2325ee229 https://go.googlecode.com/hg #
Total comments: 1
Patch Set 9 : diff -r f5d2325ee229 https://go.googlecode.com/hg #Patch Set 10 : diff -r f5d2325ee229 https://go.googlecode.com/hg #Patch Set 11 : diff -r f5d2325ee229 https://go.googlecode.com/hg #Patch Set 12 : diff -r f5d2325ee229 https://go.googlecode.com/hg #
MessagesTotal messages: 23
|