slack icon indicating copy to clipboard operation
slack copied to clipboard

fix: create multipart form when multipart request

Open EkeMinusYou opened this issue 2 years ago • 3 comments

This PR fixs form parameter format when multipart request.

EkeMinusYou avatar Oct 23 '22 16:10 EkeMinusYou

@EkeMinusYou Could you add an explanation of what the problem is with the current implementation, or a link to the issue?

kanata2 avatar Oct 31 '22 21:10 kanata2

@kanata2 It is not clearly described in Slack's API documentation and is difficult to explain.

https://api.slack.com/methods/files.remote.add

However, when I checked the actual behavior, it seems that in the case of mutlipart request, the parameters must be put in the body instead of the query. Otherwise the token cannot be passed and authentication will fail.

EkeMinusYou avatar Feb 09 '23 18:02 EkeMinusYou

Hi @EkeMinusYou @kanata2 , any updates on this?

context:

This worked fine for me when using files.remote.add using postman with same params but failed with slack-go

I was receiving invalid_auth when using AddRemoteFileContext. I had not investigated why this was happening but I did check my bot token and all other attributes.

Seems like this PR should fix that issue.

samarthkathal avatar Jun 08 '24 23:06 samarthkathal

@samarthkathal this PR may be a valid fix for #1295 but I've having some trouble reproducing the issue to understand whether this would fix it. Would you be able to help me reproduce the issue?

lorenzoaiello avatar Jul 15 '24 02:07 lorenzoaiello

@samarthkathal this PR may be a valid fix for #1295 but I've having some trouble reproducing the issue to understand whether this would fix it. Would you be able to help me reproduce the issue?

@lorenzoaiello see my comment here to repro: https://github.com/slack-go/slack/issues/1295#issuecomment-2234141986

jjjjeeffff avatar Aug 09 '24 22:08 jjjjeeffff