poscat0x04 / wgcf-teams

BSD 3-Clause "New" or "Revised" License
78 stars 13 forks source link

Error when parsing auto_connect field #9

Open lincheney opened 10 months ago

lincheney commented 10 months ago

I was receiving the following error after pasting in the JWT:

Error: Failed to parse the result returned by cloudflare

Caused by:
    0: error decoding response body: invalid value: integer `1800`, expected u8 at line 1 column 21801
    1: invalid value: integer `1800`, expected u8 at line 1 column 21801

The field that is causing issues is WarpPolicy::auto_connect. If I change it to a f64, then it works. (Maybe related? https://github.com/serde-rs/json/issues/320)

Additionally, if I change https://github.com/poscat0x04/wgcf-teams/blob/a71e471cf7c9b5f93c01386f78baa35b99f661bf/src/registration.rs#L391 to be non-zero e.g. 1800, then that also causes the test to fail. Not sure if this is the right approach.