diff options
author | Linus Groh <mail@linusgroh.de> | 2022-10-16 18:04:46 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-16 18:04:46 +0200 |
commit | 0ea4d228e6e49e78ddeef623a2799c772e820dd1 (patch) | |
tree | 45760a50cca0afad4a7c1dc22a8df5040acde70b | |
parent | 1c979889b2b6fa81495e7a1fbc22f56faaac1ab2 (diff) | |
download | serenity-0ea4d228e6e49e78ddeef623a2799c772e820dd1.zip |
LibWeb: Add missing body has_value() check in XMLHttpRequest::send()
-rw-r--r-- | Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<void> XMLHttpRequest::send(Optional<Variant<JS::Handle<DOM:: if (!m_request_headers.contains("Content-Type"sv)) { if (body_with_type.has_value() && body_with_type->type.has_value()) { request.set_header("Content-Type", String { body_with_type->type->span() }); - } else if (body->has<JS::Handle<DOM::Document>>()) { + } else if (body.has_value() && body->has<JS::Handle<DOM::Document>>()) { request.set_header("Content-Type", "text/html;charset=UTF-8"); } } |