-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
In documentation the function http.DumpRequest is defined to dump the request's wire representation. In reality it makes up some fields. In below example notice how my telnet is reported to be a "Go http package". package main import "http" func dump(w http.ResponseWriter, req *http.Request) { dump, _ := http.DumpRequest(req, false) w.Write(dump) } func main() { http.ListenAndServe(":6060", http.HandlerFunc(dump)) } Connected to localhost. Escape character is '^]'. GET / HTTP/1.0 HTTP/1.0 200 OK Date: Sun, 18 Sep 2011 18:39:54 GMT Content-Type: text/plain; charset=utf-8 GET / HTTP/1.1 Host: User-Agent: Go http package Connection closed by foreign host.