Skip to content

Commit

Permalink
fix :
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Aug 17, 2023
1 parent 29e032c commit 20f31c6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.2.24
v0.2.25
2 changes: 2 additions & 0 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ func expandURL(u *url.URL, expansions map[string]string) error {

// Set the path parameters
u.RawQuery = values.Encode()
// We want colons in the query string to be unescaped.
u.RawQuery = strings.Replace(u.RawQuery, "%253A", ":", -1)

return nil
}
8 changes: 8 additions & 0 deletions cmd/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ func TestExpandURL(t *testing.T) {
},
testServerURL + "/file/convert?outputFormat=obj&srcFormat=step",
},
// Path params added as extras.
{
"file/mass",
map[string]string{
"unit": "kg:m3",
},
testServerURL + "/file/mass?unit=kg:m3",
},
}

for i, test := range expandTests {
Expand Down
2 changes: 2 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ func expandURL(u *url.URL, expansions map[string]string) error {

// Set the path parameters
u.RawQuery = values.Encode()
// We want colons in the query string to be unescaped.
u.RawQuery = strings.Replace(u.RawQuery, "%253A", ":", -1)

return nil
}
8 changes: 8 additions & 0 deletions utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ func TestExpandURL(t *testing.T) {
},
testServerURL + "/file/convert?outputFormat=obj&srcFormat=step",
},
// Path params added as extras.
{
"file/mass",
map[string]string{
"unit": "kg:m3",
},
testServerURL + "/file/mass?unit=kg:m3",
},
}

for i, test := range expandTests {
Expand Down

0 comments on commit 20f31c6

Please sign in to comment.