Skip to content
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

Fix issues with serialising x-www-form-urlencoded data + Change Backend SSLCiphers field from []string to string #304

Merged
merged 4 commits into from
Sep 21, 2021

Conversation

Integralist
Copy link
Collaborator

@Integralist Integralist commented Sep 20, 2021

  • Creating tokens using the foo|0=A&foo|1=B format doesn't work with our API endpoint, so switch to foo[]=A&foo[]=B.
  • Creating/updating backends were incorrectly asking for a slice of strings, rather than a string that was colon delimited.

NOTE: Refer to the updated fixture files to see the difference in API response.

form:
name:
- my-test-token-1
password:
- foobar
scope:
- global
services[]:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice the VCR package now correctly marshals the values into the request body.

url: https://api.fastly.com/tokens
method: POST
response:
body: '{"id":"67WnFZog4TztGgdNfc9mxX","name":"my-test-token-1","user_id":"52LiGaZmbWl4D5xv4tcxON","customer_id":"51MumwLiSJyFTWhtbByYgR","service_id":null,"expires_at":null,"created_at":"2021-09-15T16:10:56Z","updated_at":"2021-09-15T16:10:56Z","scope":"global","services":[],"access_token":"XXXXXXXXXXXXXXXXXXXXXX"}'
body: '{"id":"27DePetT24oLN9xdXRMkdo","name":"my-test-token-1","user_id":"52LiGaZmbWl4D5xv4tcxON","customer_id":"51MumwLiSJyFTWhtbByYgR","service_id":"6besTz8jIUQudhhr4vLEzt","expires_at":null,"created_at":"2021-09-20T11:24:38Z","updated_at":"2021-09-20T11:24:38Z","scope":"global","services":["5wHdzYhbILBcvU2aAjH8so","6besTz8jIUQudhhr4vLEzt"],"access_token":"XXXXXXXXXXXXXXXXXXXXXX"}'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice the API response now correctly includes a value for the services field.

@Integralist Integralist merged commit c05acd7 into main Sep 21, 2021
@Integralist Integralist deleted the integralist/fix-urlencoding-for-arrays branch September 21, 2021 09:10
@Integralist Integralist changed the title Fix issues with serialising x-www-form-urlencoded data Fix issues with serialising x-www-form-urlencoded data + Change Backend SSLCiphers field from []string to string Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants