From b1a610ee74fc3db89a88d3ad70a1798f1613ef5a Mon Sep 17 00:00:00 2001
From: Daniel Barton <danielb@purpleflaghosting.com>
Date: Tue, 16 Apr 2024 19:41:54 +0800
Subject: [PATCH] Correct Content-Type and add support for wider range of
 response codes in wings diagnostics

---
 cmd/diagnostics.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/diagnostics.go b/cmd/diagnostics.go
index c7362e1..3fef9ee 100644
--- a/cmd/diagnostics.go
+++ b/cmd/diagnostics.go
@@ -229,8 +229,8 @@ func uploadToHastebin(hbUrl, content string) (string, error) {
 		return "", err
 	}
 	u.Path = path.Join(u.Path, "documents")
-	res, err := http.Post(u.String(), "plain/text", r)
-	if err != nil || res.StatusCode != 200 {
+	res, err := http.Post(u.String(), "text/plain", r)
+	if err != nil || res.StatusCode < 200 || res.StatusCode >= 300 {
 		fmt.Println("Failed to upload report to ", u.String(), err)
 		return "", err
 	}