1
0
mirror of https://github.com/lus/pasty.git synced 2023-08-10 21:13:09 +03:00

implicitly write 200 HTTP status code

This commit is contained in:
Lukas Schulte Pelkum
2023-06-17 17:05:34 +02:00
parent c414fd7c59
commit 18839a2021
3 changed files with 24 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/lus/pasty/internal/pastes"
"github.com/lus/pasty/internal/reports"
"github.com/lus/pasty/internal/storage"
"github.com/lus/pasty/pkg/chiimplicitok"
"github.com/lus/pasty/pkg/chizerolog"
"net/http"
)
@@ -52,6 +53,7 @@ func (server *Server) Start() error {
router.Use(chizerolog.Logger)
router.Use(chizerolog.Recover)
router.Use(chiimplicitok.Middleware)
// Register the web frontend handler
router.Get("/*", frontendHandler(router.NotFoundHandler()))

View File

@@ -15,5 +15,4 @@ func (server *Server) v2EndpointDeletePaste(writer http.ResponseWriter, request
if err := server.Storage.Pastes().DeleteByID(request.Context(), paste.ID); err != nil {
writeErr(request, writer, err)
}
writer.WriteHeader(http.StatusOK)
}