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

Upload: Only sign required params #25

Conversation

udipl
Copy link
Contributor

@udipl udipl commented Jun 21, 2021

Brief Summary of Changes

The Upload API request signing includes all passed parameters to the signing method, despite the documentation clearly states that All parameters added to the method call should be included except: file, cloud_name, resource_type and your api_key.
The server rejects signatures that include one of these values.

This breaks when a ResourceType field is non-empty in an UploadParams struct for a request; it gets marshaled as resource_type and included in the signature, which doesn't match the server's logic.

What does this PR address?

Are tests included?

  • Yes
  • No

Reviewer, please note:

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I ran the full test suite before pushing the changes and all the tests pass.

@const-cloudinary const-cloudinary merged commit 3ea19ca into cloudinary:main Jun 24, 2021
@const-cloudinary
Copy link
Collaborator

@udipl, thank you for contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants