revert(inspect): drop /html route

Removes htmlPathPattern, serveHTML, and the dispatch block that called
it; HTML capture no longer exists on disk.
This commit is contained in:
pj committed 2026-04-27 19:53:20 +07:00
1 parent 1ec019e632
commit 1a333f2eaa
2 files changed
-64

No files matched your search

-19
View File
@@ -84,7 +84,6 @@ func (s *Server) handleRunsList(responseWriter http.ResponseWriter, request *htt
var stepPathPattern = regexp.MustCompile(`^([a-zA-Z0-9._-]+)/steps/([^/]+)$`)
var screenshotPathPattern = regexp.MustCompile(`^([a-zA-Z0-9._-]+)/screenshots/([a-zA-Z0-9._-]+\.png)$`)
var htmlPathPattern = regexp.MustCompile(`^([a-zA-Z0-9._-]+)/html/([a-zA-Z0-9._-]+\.html)$`)
var runDetailPathPattern = regexp.MustCompile(`^([a-zA-Z0-9._-]+)/?$`)
func (s *Server) handleRunsTree(responseWriter http.ResponseWriter, request *http.Request) {
@@ -105,10 +104,6 @@ func (s *Server) handleRunsTree(responseWriter http.ResponseWriter, request *htt
s.serveScreenshot(responseWriter, request, match[1], match[2])
return
}
if match := htmlPathPattern.FindStringSubmatch(rest); match != nil {
s.serveHTML(responseWriter, request, match[1], match[2])
return
}
if match := runDetailPathPattern.FindStringSubmatch(rest); match != nil {
s.serveDetail(responseWriter, match[1])
return
@@ -165,20 +160,6 @@ func (s *Server) serveScreenshot(responseWriter http.ResponseWriter, request *ht
http.ServeFile(responseWriter, request, full)
}
func (s *Server) serveHTML(responseWriter http.ResponseWriter, request *http.Request, id, name string) {
if !validRunID(id) || strings.Contains(name, "..") {
http.Error(responseWriter, "run not found", http.StatusNotFound)
return
}
full := filepath.Join(s.options.RunsDirectory, id, "html", name)
if _, err := http.Dir(filepath.Join(s.options.RunsDirectory, id, "html")).Open(name); err != nil {
http.NotFound(responseWriter, request)
return
}
responseWriter.Header().Set("Content-Type", "text/html; charset=utf-8")
http.ServeFile(responseWriter, request, full)
}
func (s *Server) handleEvents(responseWriter http.ResponseWriter, request *http.Request) {
flusher, ok := responseWriter.(http.Flusher)
if !ok {