-
Notifications
You must be signed in to change notification settings - Fork 11
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
Enforce User-Agent header to be set. Fixes #53 #55
Conversation
Just dont set the header at all and it will be present. |
Just tried it: If the ua-header is not set explicitly, "Go-http-client/1.1" is used. But in this case, I get the 404 error again. Looks like Nissan is blocking some user agents. |
…or thats the login error now? |
Why don't you try it yourself? The behaviour is reproducible. I would not be suprised if they would try to block "non-official" requests. Ideally, we would set the user agent identical to the official app. Does anyone know what is set there? |
I did. Doesn't work for me. That's why I've asked
|
@joeshaw could you kindly merge? |
@mschaeuble or would you want to use a more common, non-easily-blockable UA string? |
@andig Do you have any suggestion for a better UA string? Not sure if having a random UA string is better because Nissan could whitelist "official" user agents, which are currently not reverse-engineered as far as I know. I would prefer something neutral, such that the request cannot be tracked down to this project. |
Something with Chrome? |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36" ? |
carwings.go
Outdated
|
||
// A user agent is required. Using an unobtrusive value to not attract attention. | ||
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36") | ||
req.Header.Set("Content-Type", "application/x-www-form-urlencoded") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatierung...
Thank you! |
A User-Agent header is required for the login. Fixes #53 .