Parse ClientPollRequest version in DecodeClientPollRequest

Instead of IPC.ClientOffers.  This makes things consistent with
EncodeClientPollRequest which adds the version while serializing.
This commit is contained in:
Arlo Breault 2022-03-09 19:48:16 -05:00
parent 6fd0f1ae5d
commit 829cacac5f
6 changed files with 52 additions and 57 deletions

View file

@ -146,8 +146,9 @@ func clientOffers(i *IPC, w http.ResponseWriter, r *http.Request) {
if len(body) > 0 && body[0] == '{' {
isLegacy = true
req := messages.ClientPollRequest{
Offer: string(body),
NAT: r.Header.Get("Snowflake-NAT-Type"),
Offer: string(body),
NAT: r.Header.Get("Snowflake-NAT-Type"),
Version: messages.ClientVersion1_0,
}
body, err = req.EncodeClientPollRequest()
if err != nil {