zrok/endpoints/publicProxy/unauthorizedUi/handler.go
2023-09-05 09:55:55 -05:00

22 lines
372 B
Go

package unauthorizedUi
import (
"github.com/sirupsen/logrus"
"net/http"
)
func WriteUnauthorized(w http.ResponseWriter) {
if data, err := FS.ReadFile("index.html"); err == nil {
w.WriteHeader(http.StatusNotFound)
n, err := w.Write(data)
if n != len(data) {
logrus.Errorf("short write")
return
}
if err != nil {
logrus.Error(err)
return
}
}
}