|
|
@ -20,9 +20,9 @@ var _ http.Handler = &CatHandler{}
|
|
|
|
func (cs *CatHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|
|
|
func (cs *CatHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|
|
|
log.Printf("[%s] %s %s", req.Host, req.Method, req.URL.Path)
|
|
|
|
log.Printf("[%s] %s %s", req.Host, req.Method, req.URL.Path)
|
|
|
|
|
|
|
|
|
|
|
|
w.Write([]byte(fmt.Sprintf("HTTP1.1 %s %s\n", req.Method, req.URL.Path)))
|
|
|
|
w.Write([]byte(fmt.Sprintf("%s %s %s\n", req.Proto, req.Method, req.URL.Path)))
|
|
|
|
for k, v := range req.Header {
|
|
|
|
for k, v := range req.Header {
|
|
|
|
w.Write([]byte(fmt.Sprintf("%s: %s\n", k, strings.Join(v, ", "))))
|
|
|
|
w.Write([]byte(fmt.Sprintf("%s: %s\n", k, strings.Join(v, "; "))))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
w.Write([]byte{'\n'})
|
|
|
|
w.Write([]byte{'\n'})
|
|
|
|
|
|
|
|
|
|
|
|