fix: ext-auth crash bugfix (#1705)

This commit is contained in:
韩贤涛
2025-01-23 11:29:49 +08:00
committed by GitHub
parent 133a30b8d5
commit 9d8e78dae3
2 changed files with 14 additions and 6 deletions

View File

@@ -49,13 +49,17 @@ func GetRequestPath() string {
return path
}
func GetRequestPathWithoutQuery() (string, error) {
func GetRequestPathWithoutQuery() string {
rawPath := GetRequestPath()
if rawPath == "" {
return ""
}
path, err := url.Parse(rawPath)
if err != nil {
return "", err
proxywasm.LogErrorf("failed to parse request path '%s': %v", rawPath, err)
return ""
}
return path.Path, nil
return path.Path
}
func GetRequestMethod() string {