summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Fetch/Response.h
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2023-03-02 22:26:12 +0000
committerLinus Groh <mail@linusgroh.de>2023-03-03 09:25:34 +0000
commit7f9ddcf4202b8870be5c1ec865632137d02b06f9 (patch)
treeb2c76d1cf0de86f3937d0ecdef6404e94daf5ab3 /Userland/Libraries/LibWeb/Fetch/Response.h
parentf561940e548f874a093cec484349d38f7acb76dd (diff)
downloadserenity-7f9ddcf4202b8870be5c1ec865632137d02b06f9.zip
LibWeb/Fetch: Port JS interfaces to new String
Since BodyInit and Headers are tightly coupled to both Request and Response, I chose to do all of them at once instead of introducing a bunch of temporary conversion glue code.
Diffstat (limited to 'Userland/Libraries/LibWeb/Fetch/Response.h')
-rw-r--r--Userland/Libraries/LibWeb/Fetch/Response.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/Fetch/Response.h b/Userland/Libraries/LibWeb/Fetch/Response.h
index 516a680c6c..4ae12d7624 100644
--- a/Userland/Libraries/LibWeb/Fetch/Response.h
+++ b/Userland/Libraries/LibWeb/Fetch/Response.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
+ * Copyright (c) 2022-2023, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -21,7 +21,7 @@ namespace Web::Fetch {
// https://fetch.spec.whatwg.org/#responseinit
struct ResponseInit {
u16 status;
- DeprecatedString status_text;
+ String status_text;
Optional<HeadersInit> headers;
};
@@ -46,14 +46,14 @@ public:
// JS API functions
[[nodiscard]] static JS::NonnullGCPtr<Response> error(JS::VM&);
- [[nodiscard]] static WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> redirect(JS::VM&, DeprecatedString const& url, u16 status);
- [[nodiscard]] static WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> json(JS::VM&, JS::Value data, ResponseInit const& init = {});
+ static WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> redirect(JS::VM&, String const& url, u16 status);
+ static WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> json(JS::VM&, JS::Value data, ResponseInit const& init = {});
[[nodiscard]] Bindings::ResponseType type() const;
- [[nodiscard]] DeprecatedString url() const;
+ [[nodiscard]] WebIDL::ExceptionOr<String> url() const;
[[nodiscard]] bool redirected() const;
[[nodiscard]] u16 status() const;
[[nodiscard]] bool ok() const;
- [[nodiscard]] DeprecatedString status_text() const;
+ [[nodiscard]] WebIDL::ExceptionOr<String> status_text() const;
[[nodiscard]] JS::NonnullGCPtr<Headers> headers() const;
[[nodiscard]] WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> clone() const;