From 95c3ac899f8e3d3197eb43c512b3c9f6ff1c4479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Wei=C3=9F?= Date: Sat, 11 Jan 2020 18:08:28 +0100 Subject: [PATCH] Return status code 201 on PUT success XEP-0363 (version 0.9.0) says: | An HTTP status code of 201 means that the server is now ready to serve | the file via the provided GET URL. Some clients assume the upload failed when receiving a status code of 200, so we now return 201 instead. --- main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/main.go b/main.go index 4bd5a6e..9e9d6c2 100644 --- a/main.go +++ b/main.go @@ -113,6 +113,7 @@ func handleRequest(w http.ResponseWriter, r *http.Request) { } log.Println("Successfully written", n, "bytes to file", fileStorePath) + w.WriteHeader(http.StatusCreated) } else { log.Println("Invalid MAC.") http.Error(w, "403 Forbidden", 403)