-
Notifications
You must be signed in to change notification settings - Fork 679
fix(web-api): complete file upload v2 calls if absolute urls are not allowed #2196
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
Conversation
❌ 1 Tests Failed:
View the full list of 2 ❄️ flaky tests
To view more test analytics, go to the Test Analytics Dashboard |
WilliamBergamin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this refactor, I believe it properly isolates the responsibility of apiCall and makeRequest, elegant fix 💯
But these changes affect a critical section of the web-api package (logic used by every user), this is why I left a comment highlighting the importance of properly scoping this PR
|
@WilliamBergamin Thanks so much for the review and excellent suggestions as always ✨ I updated the test changes to be more focused on the These changes are also tested to be working in production and development, with both standard API methods and |
WilliamBergamin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good 💯 thanks for catching this 🥇
|
@WilliamBergamin Thanks once more for these reviews and improvements to testing in the meantime! I'll merge this now to follow up with a patch soon 🚢 💨 |
Summary
This PR fixes an issue where setting the
allowAbsoluteUrlsoption totruecauses thefilesUploadV2method to error!Some investigating points at the "https://files.slack.com/..." URL gathered to POST files to having a different base URL than other API request at "https://slack.com/api/..." 🤖
Preview
The changes of this PR make the following example upload as expected:
Notes
Changes were made to derive the absolute URL to use in requests before the internal
makeRequestfunction. This was done since both.apiCalland.filesUploadV2make requests using different URLs but the sameaxiosclient 👾Requirements