repro-run/gitea-ci/static.go

14 lines
222 B
Go
Raw Normal View History

2023-01-23 14:30:42 +00:00
package main
import "net/http"
type staticRoute struct {
file []byte
mime string
}
func (s staticRoute) ServeHTTP(w http.ResponseWriter, req *http.Request) {
w.Header().Add("Content-Type", s.mime)
w.Write(s.file)
}