|
|
@ -87,8 +87,15 @@ func main() {
|
|
87
|
87
|
})
|
|
88
|
88
|
|
|
89
|
89
|
http.HandleFunc("/_log", func(w http.ResponseWriter, req *http.Request) {
|
|
90
|
|
if strings.Contains(req.Header.Get("Accept"), "application/yaml") {
|
|
91
|
|
err := renderYAML(w, requestLog.AsResponses())
|
|
|
90
|
showCache := flags.cache && req.URL.Query().Get("cache") == "true"
|
|
|
91
|
if showCache || strings.Contains(req.Header.Get("Accept"), "application/yaml") {
|
|
|
92
|
var rs []Response
|
|
|
93
|
if showCache {
|
|
|
94
|
rs = responses.responses
|
|
|
95
|
} else {
|
|
|
96
|
rs = requestLog.AsResponses()
|
|
|
97
|
}
|
|
|
98
|
err := renderYAML(w, rs)
|
|
92
|
99
|
if err != nil {
|
|
93
|
100
|
log.Printf("Error: Render log: %s", err)
|
|
94
|
101
|
}
|