fix max newAuthenticatedRequest for nil data

This commit is contained in:
c9s 2020-10-18 00:05:54 +08:00
parent 9ebccc72ba
commit 530da665d3

View File

@ -183,6 +183,14 @@ func (c *RestClient) newAuthenticatedRequest(m string, refURL string, data inter
var p []byte
switch d := data.(type) {
case nil:
payload := map[string]interface{}{
"nonce": c.getNonce(),
"path": c.BaseURL.ResolveReference(rel).Path,
}
p, err = json.Marshal(payload)
case map[string]interface{}:
payload := map[string]interface{}{
"nonce": c.getNonce(),