- fix middleware ordering
This commit is contained in:
cardinalnsk 2025-12-03 05:41:24 +07:00
parent eeb512c98a
commit bcea539250
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ import (
"net/http/httputil" "net/http/httputil"
"net/url" "net/url"
"os" "os"
"strings" "strings"
"yobble-gateway-go/internal/config" "yobble-gateway-go/internal/config"
"yobble-gateway-go/internal/logger" "yobble-gateway-go/internal/logger"

View File

@ -34,9 +34,9 @@ func NewServer(cfg *config.Settings, geoIPService *geoip.GeoIPService) *Server {
//Initialize country middleware //Initialize country middleware
countryMW := &middleware.CountryMW{Geo: geoIPService} countryMW := &middleware.CountryMW{Geo: geoIPService}
// Apply middleware chain // Apply middleware chain
chain := countryMW.AddCountryHeaderIPMiddleware( chain := middleware.RemoveTrailingSlashMiddleware(
middleware.RemoveTrailingSlashMiddleware( middleware.RealIPMiddleware(
middleware.RealIPMiddleware( countryMW.AddCountryHeaderIPMiddleware(
proxyHandler, proxyHandler,
), ),
), ),