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

Tweak the User-Agent a bit #1153

Merged
merged 2 commits into from
Nov 26, 2022

Conversation

daenney
Copy link
Member

@daenney daenney commented Nov 26, 2022

I've tried to tweak the User-Agent a bit to better match my understanding/interpretation of RFC 7231. But in the real world nobody really seems to agree on how these things should be formatted and what they contain so idk if this change is worth it.

This also flips it to use the account domain instead of the host domain, so that when you're looking at the header you can better identify the source of the request.

By using the account domain we can pinpoint the source of the request
more accurately when looking at the User-Agent header.
@NyaaaWhatsUpDoc
Copy link
Member

Is it worth having the github url in it? i just worry it makes the UA a bit too long.

@daenney
Copy link
Member Author

daenney commented Nov 26, 2022

Is it worth having the github url in it? i just worry it makes the UA a bit too long.

Ya, I've been pondering about that too. It's getting a little extreme. Lets drop that.

Based on RFC 7231, our User-Agent header doesn't quite match. It seems
to always want Name [/ Version] pairs, with comments in parenthesis and
multiple comments separated by a semicolon.

Align our UA with that, using application name first by itself in case
someone has customised it with the source instance in a comment. Follow
that up with gotosocial/<version> and a comment pointing at the source
code.

This also drops the mention of gofed/activity since a fork is in use.
@daenney
Copy link
Member Author

daenney commented Nov 26, 2022

There, that should be better.

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc merged commit d6f4d19 into superseriousbusiness:main Nov 26, 2022
@daenney daenney deleted the ua-tweaks branch November 26, 2022 20:16
@daenney
Copy link
Member Author

daenney commented Nov 26, 2022

@NyaaaWhatsUpDoc I just realised I'm an idiot. We do want to use Host and not the AccountDomain, since Host would be the actual address the server runs on.

I have no idea how I read this the wrong way around.

[edit] Raise #1156 to revert/fix that

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