Skip to content
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

Add an useragent when downloading unity libraries #546

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

miniduikboot
Copy link
Contributor

@miniduikboot miniduikboot commented Jan 24, 2023

Description

This adds an user agent to the download request, which is configured to be BepInEx/ + the version of BepInEx in use.

Reporting an OS or pretending to be an actual browser didn't feel right

Motivation and Context

Currently users in some countries are blocked from downloading unity libs, although they are able to download the libraries using their browser. Because of this I'm assuming that the combination of country and the lack of an user agent is causing the download to fail. Add an user agent identifying us as BepInEx and hope that makes the request less sus.

This hopefully fixes what I've been calling the Kazakhstan problem, as reported by me in April last year: https://discord.com/channels/623153565053222947/624272422295568435/968527472377344070 . This issue doesn't appear frequently, but in support channels we only see the tip of the iceberg. So far I've seen users with issues in Kazakhstan (3), Pakistan (1) and Russia (1).

How Has This Been Tested?

  • I tested it against the original server => still works
  • I tested it against a local cache to verify it actually sets an user agent => see screenshot for a before/after
  • I'm reaching out to a user in one of the affected countries to see if this lets them download from the original server => WIP

Screenshots (if appropriate):

Http server log of the results of step 2:
2023-01-24T20:56:22,000477055+01:00

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Currently users in some countries are blocked from downloading unity
libs, although they are able to download the libraries using their
browser. Because of this I'm assuming that the combination of country
and the lack of an user agent is causing the download to fail. Add an
user agent identifying us as BepInEx and hope that makes the request
less sus.
@ManlyMarco
Copy link
Member

Did this end up fixing the download issue for the affected users?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants