cmd(diagnostics): fix Content-Type
and accept more status codes (#186)
This commit is contained in:
parent
1d5090957b
commit
ec54371b86
|
@ -229,8 +229,8 @@ func uploadToHastebin(hbUrl, content string) (string, error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
u.Path = path.Join(u.Path, "documents")
|
u.Path = path.Join(u.Path, "documents")
|
||||||
res, err := http.Post(u.String(), "plain/text", r)
|
res, err := http.Post(u.String(), "text/plain", r)
|
||||||
if err != nil || res.StatusCode != 200 {
|
if err != nil || res.StatusCode < 200 || res.StatusCode >= 300 {
|
||||||
fmt.Println("Failed to upload report to ", u.String(), err)
|
fmt.Println("Failed to upload report to ", u.String(), err)
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user