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

Custom User-Agent at utils/request #520

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

touhidurrr
Copy link
Contributor

resolves #519

@jmerle
Copy link
Owner

jmerle commented Nov 11, 2024

I'm not against making it possible for OJ's to recognize which requests are coming from Competitive Companion, but the User-Agent header isn't an option because Chrome doesn't allow overriding it. The fetch specification says it should be possible, but the corresponding Chromium bug report hasn't been fixed for nearly 9 years.

I've slightly modified your code to use the X-Competitive-Companion header rather than the User-Agent header to indicate a request is coming from Competitive Companion, as that header can be set on all browsers. Can you check with the person that requested the User-Agent change whether this approach is satisfactory on their end?

@touhidurrr
Copy link
Contributor Author

touhidurrr commented Nov 11, 2024

@jmerle I pinged them with the PR link. Let's see if they reply. If not, you can merge this after a day or two. However, it is to be noted that they did not mention this as a requirement. They just expressed that it would be nice if it was there.

@mehedi-shafi
Copy link

Thank you both, @touhidurrr and @jmerle, I'm one of the maintainers of baps-oj and we really appreciate you taking the time make this. Will help us understand where the requests are coming from.

@jmerle jmerle merged commit 188e7e7 into jmerle:master Nov 15, 2024
1 check passed
@touhidurrr touhidurrr deleted the custom-user-agent branch November 16, 2024 16:38
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.

Should Competitive Companion use a User-Agent header in fetch requests so that judges can recognise it?
3 participants