Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is useful to debug errors that occur because of bad plists sent by clients. Usually in this case, one receives a not-very-useful error such as `HTTP status 400 (Bad Request): <opaque error>`. ## Test Plan 1. Patch `mdmb` so that it sends bad checkins ``` diff --git a/internal/device/mdm.go b/internal/device/mdm.go index 33a4c50..cda3d69 100644 --- a/internal/device/mdm.go +++ b/internal/device/mdm.go @@ -185,10 +185,7 @@ func (c *MDMClient) connect(client *http.Client, connReq interface{}) error { return errors.New("device not enrolled") } - plistBytes, err := plist.Marshal(connReq) - if err != nil { - return err - } + plistBytes := []byte("aoeuaoeuaoeu") ``` 2. Run ``` $mdmb -uuids $uuid devices-connect ``` 3. Observe more verbose NanoMDM log: ``` 2022/07/21 15:52:43 level=info handler=checkin-command trace_id=1af087fdc6de5381 msg=command report results err=HTTP status 400 (Bad Request): decoding command results: parse error: EOF: raw body: aoeuaoeuaoeu ```
- Loading branch information