-
Notifications
You must be signed in to change notification settings - Fork 102
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
retry for other region #315
retry for other region #315
Conversation
62f4395
to
ba1f786
Compare
ba1f786
to
0a515b7
Compare
1d04436
to
a514512
Compare
00bec7c
to
a81d234
Compare
a81d234
to
babf86c
Compare
proxyReq.URL.Host = acct.Host | ||
log.Debug("Forwarding request to %s", proxyReq.URL.String()) | ||
client := http.Client{} | ||
result, err := client.Do(proxyReq) |
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.
Sorry to resurrect this but I worry this isn't going to work. This proxyReq
is assigned a request body of req.Body
at the start of the function on line 182, but on line 213 we drain req.Body
completely, so I think we're never going to send a body here.
In testing, stuff like fleet_status is failing every time when Tesla validates the request body. Just GET-ing data is working, however.
Sorry, I should have noticed this earlier.
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.
Maybe on line 218 we should write
proxyReq.Body = io.NopCloser(bytes.NewBuffer(requestBody))
?
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.
Thanks for testing this out. Indeed. the proxyReq is the real request being sent out. Will fxi it.
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.
Description
currently vehicle command will retry commands if tesla host return 421. We want to share the same behavior for other proxied request as well.
Fixes # (issue)
Type of change
Please select all options that apply to this change:
Checklist:
Confirm you have completed the following steps: