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

Send User-Agent HTTP header on requests #216

Open
oznogon opened this issue Jan 16, 2023 · 0 comments
Open

Send User-Agent HTTP header on requests #216

oznogon opened this issue Jan 16, 2023 · 0 comments

Comments

@oznogon
Copy link
Contributor

oznogon commented Jan 16, 2023

Some websites, such as GitHub's API, refuse requests from clients that don't provide a User-Agent header, so SP should pass one.

Not sure how to get a version number or specific app name here, but for example just this satisfies basic requirements:

index 789070a..4450f30 100644
--- a/src/io/http/request.cpp
+++ b/src/io/http/request.cpp
@@ -12,6 +12,7 @@ Request::Request(const string& host, int port, Scheme scheme)
 : port(port), scheme(scheme)
 {
     headers["Host"] = host;
+    headers["User-Agent"] = "SeriousProton/0.0.0";
 }
 
 void Request::setHeader(const string& key, const string& value)
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

No branches or pull requests

1 participant