Cookies in http package

63 views
Skip to first unread message

nilsocket

unread,
Feb 5, 2021, 9:03:38 AM2/5/21
to golang-nuts
  func main() {
     c := &http.Cookie{
     Name: "cookie",
     Value: "\"hello\"",
     }
   fmt.Println(c)
  }

1. Why too much work being done while printing, shouldn't this be done only once?
2. Why not provide http.NewCookie() to check for validation and print normally?

Thank you.

nilsocket

unread,
Feb 5, 2021, 9:09:21 AM2/5/21
to golang-nuts
Forgot to add,

Double-quotes are being dropped with log message.
as per RFC6265 a cookie-value can be enclosed in double-quotes.

Multiple issues were mentioned in github regarding this behavior but either closed or stalled,

Why isn't this issue fixed still?

Thank you.
Reply all
Reply to author
Forward
0 new messages