ttezel / twit

Twitter API Client for node (REST & Streaming API)
4.31k stars 568 forks source link

Fixed problem when making multiple calls to get bearer token #391

Closed williamcoates closed 6 years ago

williamcoates commented 7 years ago

Before the bearer token is cached (for example you make 10 calls at the same time), for some reason you sometimes get random 404s from the POST /oauth2/token call. I noticed its actually making a POST to //oauth2/token, removing the extra forward slash seems to fix the issue.

Reproduce by running mocha tests/rest_app_only_auth.js -g 'multiple times’ (adding back the extra forward slash in lib/helpers.js

Thanks to https://github.com/rssilva for the test case which I stole to reproduce the issue.

johnferro commented 6 years ago

@ttezel Any chance this could get reviewed and possibly merged in?

ttezel commented 6 years ago

@williamcoates I'll include this in twit v2.2.10 :)