mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +00:00
LibWeb: Rename safely_extract_body() to extract_body()
We have not yet implemented safely_extract_body so renaming this to extract_body() and adding a spec link.
This commit is contained in:
parent
4978f388c2
commit
42e76d8de9
1 changed files with 3 additions and 2 deletions
|
@ -310,7 +310,8 @@ Optional<MimeSniff::MimeType> XMLHttpRequest::extract_mime_type(Fetch::HeaderLis
|
|||
return mime_type;
|
||||
}
|
||||
|
||||
static XMLHttpRequest::BodyWithType safely_extract_body(XMLHttpRequestBodyInit& body)
|
||||
// https://fetch.spec.whatwg.org/#concept-bodyinit-extract
|
||||
static XMLHttpRequest::BodyWithType extract_body(XMLHttpRequestBodyInit& body)
|
||||
{
|
||||
if (body.has<NonnullRefPtr<URL::URLSearchParams>>()) {
|
||||
return {
|
||||
|
@ -464,7 +465,7 @@ DOM::ExceptionOr<void> XMLHttpRequest::send(Optional<XMLHttpRequestBodyInit> bod
|
|||
if (m_method.is_one_of("GET"sv, "HEAD"sv))
|
||||
body = {};
|
||||
|
||||
auto body_with_type = body.has_value() ? safely_extract_body(body.value()) : XMLHttpRequest::BodyWithType {};
|
||||
auto body_with_type = body.has_value() ? extract_body(body.value()) : XMLHttpRequest::BodyWithType {};
|
||||
|
||||
AK::URL request_url = m_window->associated_document().parse_url(m_url.to_string());
|
||||
dbgln("XHR send from {} to {}", m_window->associated_document().url(), request_url);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue