diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index 067cb42aac..8244360fd2 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -462,7 +462,7 @@ WebIDL::ExceptionOr XMLHttpRequest::send(Optionaltype.has_value()) { request.set_header("Content-Type", String { body_with_type->type->span() }); - } else if (body->has>()) { + } else if (body.has_value() && body->has>()) { request.set_header("Content-Type", "text/html;charset=UTF-8"); } }