-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL components are not urlencoded, resulting in API failures for objects with certain names #14
Comments
Bit of a stretch, but I've submitted a case to |
For now I think the best option avail is to write a small function which calls |
Looks like go 1.8 might fix this: golang/go@7e2bf95 |
Did this ever get fixed (in go 1.8)? I run into similar problem in Terraform 0.9.4 with conditions that included |
I have a cache condition with a name containing a character which needs to be urlencoded. (ex: a
text/html
condition). When I execute the following code which simply lists and tries to delete conditions which are found, it will fail:The reason it is failing is because it ends up calling the following URL:
(note the unescaped forward-slash)
Any parameters which go into forming an API call URL should be urlescaped to prevent issues such as this. These object names are perfectly valid from Fastly's POV, but will cause go-fastly to malfunction.
I tried to address this in go-fastly by wrapping all URL components which could contain these characters in an escape method from
net/url
. Unfortunately, name components in the Fastly API may contain not only forward slashes but also whitespace, andnet/url
has no method to deal with both possible cases. Fixing this ingo-fastly
may require that we do a bit of a hackystrings.Replace()
.The text was updated successfully, but these errors were encountered: