Set default NotFound handler.
This commit is contained in:
parent
3f79eb5b08
commit
dab675474a
@ -8,6 +8,7 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
nethttp "net/http"
|
||||
"net/netip"
|
||||
"os"
|
||||
"os/signal"
|
||||
@ -88,7 +89,9 @@ func main() {
|
||||
*keepFileForHours, *limitStorage, *limitFileSize)
|
||||
srv := http.NewHttpServer()
|
||||
|
||||
srv.SetNotFoundHandler(http.NotFound)
|
||||
srv.SetNotFoundHandler(func(w nethttp.ResponseWriter, r *nethttp.Request) {
|
||||
http.Error(w, r, nethttp.StatusNotFound, "")
|
||||
})
|
||||
|
||||
srv.ServeStatic("/assets/*filepath", hand.AssetsFS())
|
||||
srv.GET("/robots.txt", http.RobotsTxt)
|
||||
|
Loading…
Reference in New Issue
Block a user