improve handling of query parameters
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,2 +1,7 @@
|
||||
tests/*.json
|
||||
apitester
|
||||
apitester
|
||||
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
11
run_tests.go
11
run_tests.go
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user