mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
LibWeb: Implement the fetch response is CORS-cross-origin AO
This commit is contained in:
parent
29d90ccf3b
commit
e4cb27050a
2 changed files with 9 additions and 0 deletions
|
@ -170,6 +170,13 @@ 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#cors-cross-origin
|
||||||
|
bool Response::is_cors_cross_origin() const
|
||||||
|
{
|
||||||
|
// A response whose type is "opaque" or "opaqueredirect" is CORS-cross-origin.
|
||||||
|
return type() == Type::Opaque || type() == Type::OpaqueRedirect;
|
||||||
|
}
|
||||||
|
|
||||||
// Non-standard
|
// Non-standard
|
||||||
Optional<StringView> Response::network_error_message() const
|
Optional<StringView> Response::network_error_message() 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]] bool is_cors_cross_origin() const;
|
||||||
|
|
||||||
// Non-standard
|
// Non-standard
|
||||||
[[nodiscard]] Optional<StringView> network_error_message() const;
|
[[nodiscard]] Optional<StringView> network_error_message() const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue