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

Containers write don't work properly #31

Open
piferrari opened this issue May 31, 2021 · 1 comment
Open

Containers write don't work properly #31

piferrari opened this issue May 31, 2021 · 1 comment

Comments

@piferrari
Copy link

Hi,

There is a mistake in arguments between Endpoint/Containers/Files/write() (line55) and Endpoint/AbstructEndpoint/post() (line 49).

In the first method (write) when you make a call to post (line 55) you give 3 arguments :

->post(the container name?with_get_params, follow by data, and headers)

but you must add an parameter between data and headers because in the post method the 3rd parameters is used to buildPath and actually you buildPath with requestHeaders array.

I corrected it like that at

return $this->post($this->getEndpoint().$name.'/files?path='.$filepath, $data, /****** USLESS ********/ []  /****** ARRAY ******/, $headers);

but i think you can find a more elegant way.

Best regards

PS: sorry for my poor english

@ashleyhood
Copy link
Owner

Thanks @piferrari for finding that. There are 3 solutions we could do:

  1. just add the empty array as you have done (least preferred)
  2. remove the parameter argument from AbstructEndpoint.php and refactor all the code that uses it (might work)
  3. refactor the endpoints to use the parameter argument correctly (this is the best solution but the hardest to do)

Does anyone else have any preference or comments?

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

No branches or pull requests

2 participants