mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +00:00
LibWeb: Implement the fetch response's unsafe response AO
This commit is contained in:
parent
e4cb27050a
commit
dff0e8a0dc
2 changed files with 12 additions and 0 deletions
|
@ -170,6 +170,16 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> Response::clone(JS::Realm& realm
|
||||||
return new_response;
|
return new_response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#unsafe-response
|
||||||
|
JS::NonnullGCPtr<Response> Response::unsafe_response()
|
||||||
|
{
|
||||||
|
// A response's unsafe response is its internal response if it has one, and the response itself otherwise.
|
||||||
|
if (is<FilteredResponse>(this))
|
||||||
|
return static_cast<FilteredResponse&>(*this).internal_response();
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-cross-origin
|
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-cross-origin
|
||||||
bool Response::is_cors_cross_origin() const
|
bool Response::is_cors_cross_origin() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,6 +108,8 @@ public:
|
||||||
|
|
||||||
[[nodiscard]] WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> clone(JS::Realm&) const;
|
[[nodiscard]] WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> clone(JS::Realm&) const;
|
||||||
|
|
||||||
|
[[nodiscard]] JS::NonnullGCPtr<Response> unsafe_response();
|
||||||
|
|
||||||
[[nodiscard]] bool is_cors_cross_origin() const;
|
[[nodiscard]] bool is_cors_cross_origin() const;
|
||||||
|
|
||||||
// Non-standard
|
// Non-standard
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue