Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #452 we added a browser user-agent header to all requests made through all the functions in our HttpUtils module. That change is now breaking Discord integration, since it seems Discord now rejects API requests that include a user-agent header.
This PR removes the user-agent header from all requests by default, unless it is enabled with the new
append_browser_user_agent
parameter. Incidentally, the functions in HttpUtils have also been changed to use a keyword-list for their optional parameters, to avoid having to worry about positional arguments.As far as I can tell, only the screenshot and opengraph code paths require a user-agent header enabled, so I've had all the other calls omit the header by default.