Improve test suite (#628)

Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
هذا الالتزام موجود في:
Thomas Miceli
2026-03-02 14:43:24 +07:00
ملتزم من قبل GitHub
الأصل 829cd68879
التزام 6a61b720ab
32 ملفات معدلة مع 3377 إضافات و1754 حذوفات

عرض الملف

@@ -2,7 +2,6 @@ package server
import (
"fmt"
"github.com/thomiceli/opengist/internal/validator"
"net"
"net/http"
"os"
@@ -10,6 +9,8 @@ import (
"strconv"
"strings"
"github.com/thomiceli/opengist/internal/validator"
"github.com/labstack/echo/v4"
"github.com/rs/zerolog/log"
"github.com/thomiceli/opengist/internal/config"
@@ -18,19 +19,16 @@ import (
type Server struct {
echo *echo.Echo
dev bool
sessionsPath string
ignoreCsrf bool
dev bool
}
func NewServer(isDev bool, sessionsPath string, ignoreCsrf bool) *Server {
func NewServer(isDev bool) *Server {
e := echo.New()
e.HideBanner = true
e.HidePort = true
e.Validator = validator.NewValidator()
s := &Server{echo: e, dev: isDev, sessionsPath: sessionsPath, ignoreCsrf: ignoreCsrf}
s := &Server{echo: e, dev: isDev}
s.useCustomContext()
@@ -175,3 +173,7 @@ func (s *Server) createPidFile(pidPath string) error {
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
s.echo.ServeHTTP(w, r)
}
func (s *Server) Use(middleware echo.MiddlewareFunc) {
s.echo.Use(middleware)
}