Open RokoTechnology opened 2 years ago
workaround would be to call _prepareParameters and then feed that as authorization header to your http client of choice
const headers = ctx.oa._prepareParameters(config.oauth.oauth_token, config.oauth.oauth_token_secret, 'GET', params.uri)
const strHeaders = 'OAuth ' + headers.map(h => h.map(hh => encodeURIComponent(hh)).join('="')).join('", ')
const result = await ctx.got(params.uri, { headers: {
'Authorization': strHeaders
} })
GET body is always returned in utf-8 as per
https://github.com/ciaranj/node-oauth/blob/master/lib/oauth.js#L404
this is causing issue while retrieving OAuth secured images, for example
https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/message-attachments/guides/retrieving-media