diff --git a/httpbin/handlers.go b/httpbin/handlers.go index 8dbf11e3e1a2a29ab6dbb696f5910bda43904796..c4c85bd4677ef7217ebca850fa85c98799e1a8f3 100644 --- a/httpbin/handlers.go +++ b/httpbin/handlers.go @@ -982,7 +982,7 @@ func (h *HTTPBin) Base64(w http.ResponseWriter, r *http.Request) { http.Error(w, fmt.Sprintf("%s failed: %s", b.operation, base64Error), http.StatusBadRequest) return } - writeResponse(w, http.StatusOK, "text/html", result) + writeResponse(w, http.StatusOK, "text/plain", result) } // JSON - returns a sample json diff --git a/httpbin/handlers_test.go b/httpbin/handlers_test.go index ee703ddb5526e417583654873041aa2c7bda8320..8c4a31c84e5585009b21512fee82dcdd4207c7a7 100644 --- a/httpbin/handlers_test.go +++ b/httpbin/handlers_test.go @@ -2425,6 +2425,7 @@ func TestBase64(t *testing.T) { w := httptest.NewRecorder() handler.ServeHTTP(w, r) assertStatusCode(t, w, http.StatusOK) + assertContentType(t, w, "text/plain") assertBodyEquals(t, w, test.want) }) }