Join GitHub today
Replace `curl` with `reqwest` #1499
The diff stats may look scary, but the vast majority of the added lines is because
Why should we do this?
At best the curl crate required some very verbose code, or confusing APIs to make it possible to work with stack data, but at worst it led to some code that was confusing or even dangerous. A few things that were weird or gave me pause while writing this were:
What changes occur in our HTTP requests?
All requests have the following headers added:
All requests had the following header removed:
Some requests had the following header removed:
What notable changes happened in the code?
For the most part, the code is just replacing manual stuff with built-in stuff. I've removed anything that set a
While making this change, a few refactorings occurred.
The S3 code was taking a
The functions for interacting with the GitHub API were split into two pieces, one which made the request, and one which processed it. The only reason for this split was so that one consumer could intercept 404 responses and return
The only other point of note is that the changes to