rework to keep regex under specific conditions

This commit is contained in:
Scott McKendry
2026-07-28 19:53:16 +12:00
parent 3d5ab54ab8
commit cce0eaa974
3 changed files with 51 additions and 35 deletions
+8 -4
View File
@@ -9,14 +9,14 @@ import (
"regexp"
"strings"
"github.com/gin-gonic/gin"
"github.com/google/go-querystring/query"
"go.uber.org/dig"
"github.com/tinyauthapp/tinyauth/internal/model"
"github.com/tinyauthapp/tinyauth/internal/service"
"github.com/tinyauthapp/tinyauth/internal/utils"
"github.com/tinyauthapp/tinyauth/internal/utils/logger"
"go.uber.org/dig"
"github.com/gin-gonic/gin"
"github.com/google/go-querystring/query"
)
type AuthModuleType int
@@ -396,6 +396,10 @@ func (controller *ProxyController) getForwardAuthContext(c *gin.Context) (ProxyC
return ProxyContext{}, fmt.Errorf("invalid x-forwarded-uri: %w", err)
}
if parsedURI.Path == "" {
parsedURI.Path = "/"
}
proto, ok := controller.getHeader(c, "x-forwarded-proto")
if !ok {