improve handling of query parameters
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-24 21:26:33 +11:00
parent 8edbc5c2ed
commit 3e715f5390
2 changed files with 17 additions and 1 deletions

7
.gitignore vendored
View File

@@ -1,2 +1,7 @@
tests/*.json
apitester
apitester
# General
.DS_Store
.AppleDouble
.LSOverride

View File

@@ -31,11 +31,22 @@ func RunTest(testCase *TestCase) error {
// Determine URL
if len(testDefinitions.BaseUrl) > 0 {
//fmt.Printf("Joining '%s' with '%s'\n", testDefinitions.BaseUrl, testCase.Path)
requestUrl, err = url.JoinPath(testDefinitions.BaseUrl, testCase.Path)
if err != nil {
errMessage := fmt.Sprintf("error combining request URL : '%s'\n", err)
return errors.New(errMessage)
}
decoded, err := url.QueryUnescape(requestUrl)
if err != nil {
errMessage := fmt.Sprintf("error unescaping request URL : '%s'\n", err)
return errors.New(errMessage)
}
requestUrl = decoded
//fmt.Printf("url path decoded '%s'\n", decoded)
} else {
requestUrl = testCase.Path
}