
This makes XHR now rely on Fetch, which allows it to correct send Origin and Referer headers, CORS-preflight and filtering and many other goodies. The main thing that's missing is Streams, which means we can't properly produce progress events or switch to the Loading ready state. This also doesn't implement the Document responseType just yet.
28 lines
713 B
C++
28 lines
713 B
C++
/*
|
|
* Copyright (c) 2023, Luke Wilde <lukew@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
|
#include <LibWeb/Bindings/XMLHttpRequestUploadPrototype.h>
|
|
#include <LibWeb/XHR/XMLHttpRequestUpload.h>
|
|
|
|
namespace Web::XHR {
|
|
|
|
XMLHttpRequestUpload::XMLHttpRequestUpload(JS::Realm& realm)
|
|
: XMLHttpRequestEventTarget(realm)
|
|
{
|
|
}
|
|
|
|
XMLHttpRequestUpload::~XMLHttpRequestUpload() = default;
|
|
|
|
JS::ThrowCompletionOr<void> XMLHttpRequestUpload::initialize(JS::Realm& realm)
|
|
{
|
|
MUST_OR_THROW_OOM(Base::initialize(realm));
|
|
set_prototype(&Bindings::ensure_web_prototype<Bindings::XMLHttpRequestUploadPrototype>(realm, "XMLHttpRequestUpload"));
|
|
|
|
return {};
|
|
}
|
|
|
|
}
|