Skip to content

Add an useragent when downloading unity libraries#546

Closed
miniduikboot wants to merge 1 commit into
BepInEx:masterfrom
miniduikboot:fix/dl-with-useragent
Closed

Add an useragent when downloading unity libraries#546
miniduikboot wants to merge 1 commit into
BepInEx:masterfrom
miniduikboot:fix/dl-with-useragent

Conversation

@miniduikboot

@miniduikboot miniduikboot commented Jan 24, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

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

@ManlyMarco

Copy link
Copy Markdown
Member

I had this tested on multiple occasions, including just now with a fake firefox useragent, and it didn't seem to help with the download issue for affected users.

@ManlyMarco ManlyMarco added the bep6 Issues and PRs related to BepInEx 6 label Jan 27, 2026
@ManlyMarco

Copy link
Copy Markdown
Member

Closing since this did not work to fix the issue and there doesn't seem to be any reason to merge.

@ManlyMarco ManlyMarco closed this Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bep6 Issues and PRs related to BepInEx 6

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants