Requests.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. /*
  2. * Copyright (c) 2022-2023, Linus Groh <linusg@serenityos.org>
  3. * Copyright (c) 2023, networkException <networkexception@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <AK/ByteBuffer.h>
  9. #include <AK/Error.h>
  10. #include <AK/Forward.h>
  11. #include <AK/Optional.h>
  12. #include <AK/String.h>
  13. #include <AK/URL.h>
  14. #include <AK/Variant.h>
  15. #include <AK/Vector.h>
  16. #include <LibJS/Forward.h>
  17. #include <LibJS/Heap/Cell.h>
  18. #include <LibJS/Heap/GCPtr.h>
  19. #include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
  20. #include <LibWeb/Fetch/Infrastructure/HTTP/Headers.h>
  21. #include <LibWeb/HTML/Origin.h>
  22. #include <LibWeb/HTML/PolicyContainers.h>
  23. #include <LibWeb/HTML/Scripting/Environments.h>
  24. namespace Web::Fetch::Infrastructure {
  25. // https://fetch.spec.whatwg.org/#concept-request
  26. class Request final : public JS::Cell {
  27. JS_CELL(Request, JS::Cell);
  28. public:
  29. enum class CacheMode {
  30. Default,
  31. NoStore,
  32. Reload,
  33. NoCache,
  34. ForceCache,
  35. OnlyIfCached,
  36. };
  37. enum class CredentialsMode {
  38. Omit,
  39. SameOrigin,
  40. Include,
  41. };
  42. enum class Destination {
  43. Audio,
  44. AudioWorklet,
  45. Document,
  46. Embed,
  47. Font,
  48. Frame,
  49. IFrame,
  50. Image,
  51. Manifest,
  52. Object,
  53. PaintWorklet,
  54. Report,
  55. Script,
  56. ServiceWorker,
  57. SharedWorker,
  58. Style,
  59. Track,
  60. Video,
  61. WebIdentity,
  62. Worker,
  63. XSLT,
  64. };
  65. enum class Initiator {
  66. Download,
  67. ImageSet,
  68. Manifest,
  69. Prefetch,
  70. Prerender,
  71. XSLT,
  72. };
  73. enum class InitiatorType {
  74. Audio,
  75. Beacon,
  76. Body,
  77. CSS,
  78. EarlyHint,
  79. Embed,
  80. Fetch,
  81. Font,
  82. Frame,
  83. IFrame,
  84. Image,
  85. IMG,
  86. Input,
  87. Link,
  88. Object,
  89. Ping,
  90. Script,
  91. Track,
  92. Video,
  93. XMLHttpRequest,
  94. Other,
  95. };
  96. enum class Mode {
  97. SameOrigin,
  98. CORS,
  99. NoCORS,
  100. Navigate,
  101. WebSocket,
  102. };
  103. enum class Origin {
  104. Client,
  105. };
  106. enum class ParserMetadata {
  107. ParserInserted,
  108. NotParserInserted,
  109. };
  110. enum class PolicyContainer {
  111. Client,
  112. };
  113. enum class RedirectMode {
  114. Follow,
  115. Error,
  116. Manual,
  117. };
  118. enum class Referrer {
  119. NoReferrer,
  120. Client,
  121. };
  122. enum class ResponseTainting {
  123. Basic,
  124. CORS,
  125. Opaque,
  126. };
  127. enum class ServiceWorkersMode {
  128. All,
  129. None,
  130. };
  131. enum class Window {
  132. NoWindow,
  133. Client,
  134. };
  135. enum class Priority {
  136. High,
  137. Low,
  138. Auto
  139. };
  140. // Members are implementation-defined
  141. struct InternalPriority { };
  142. using BodyType = Variant<Empty, ByteBuffer, JS::NonnullGCPtr<Body>>;
  143. using OriginType = Variant<Origin, HTML::Origin>;
  144. using PolicyContainerType = Variant<PolicyContainer, HTML::PolicyContainer>;
  145. using ReferrerType = Variant<Referrer, AK::URL>;
  146. using ReservedClientType = Variant<Empty, HTML::Environment*, JS::GCPtr<HTML::EnvironmentSettingsObject>>;
  147. using WindowType = Variant<Window, JS::GCPtr<HTML::EnvironmentSettingsObject>>;
  148. [[nodiscard]] static JS::NonnullGCPtr<Request> create(JS::VM&);
  149. [[nodiscard]] ReadonlyBytes method() const { return m_method; }
  150. void set_method(ByteBuffer method) { m_method = move(method); }
  151. [[nodiscard]] bool local_urls_only() const { return m_local_urls_only; }
  152. void set_local_urls_only(bool local_urls_only) { m_local_urls_only = local_urls_only; }
  153. [[nodiscard]] JS::NonnullGCPtr<HeaderList> header_list() const { return m_header_list; }
  154. void set_header_list(JS::NonnullGCPtr<HeaderList> header_list) { m_header_list = header_list; }
  155. [[nodiscard]] bool unsafe_request() const { return m_unsafe_request; }
  156. void set_unsafe_request(bool unsafe_request) { m_unsafe_request = unsafe_request; }
  157. [[nodiscard]] BodyType const& body() const { return m_body; }
  158. [[nodiscard]] BodyType& body() { return m_body; }
  159. void set_body(BodyType body) { m_body = move(body); }
  160. [[nodiscard]] JS::GCPtr<HTML::EnvironmentSettingsObject const> client() const { return m_client; }
  161. [[nodiscard]] JS::GCPtr<HTML::EnvironmentSettingsObject> client() { return m_client; }
  162. void set_client(HTML::EnvironmentSettingsObject* client) { m_client = client; }
  163. [[nodiscard]] ReservedClientType const& reserved_client() const { return m_reserved_client; }
  164. [[nodiscard]] ReservedClientType& reserved_client() { return m_reserved_client; }
  165. void set_reserved_client(ReservedClientType reserved_client) { m_reserved_client = move(reserved_client); }
  166. [[nodiscard]] String const& replaces_client_id() const { return m_replaces_client_id; }
  167. void set_replaces_client_id(String replaces_client_id) { m_replaces_client_id = move(replaces_client_id); }
  168. [[nodiscard]] WindowType const& window() const { return m_window; }
  169. void set_window(WindowType window) { m_window = move(window); }
  170. [[nodiscard]] bool keepalive() const { return m_keepalive; }
  171. void set_keepalive(bool keepalive) { m_keepalive = keepalive; }
  172. [[nodiscard]] Optional<InitiatorType> const& initiator_type() const { return m_initiator_type; }
  173. void set_initiator_type(Optional<InitiatorType> initiator_type) { m_initiator_type = move(initiator_type); }
  174. [[nodiscard]] ServiceWorkersMode service_workers_mode() const { return m_service_workers_mode; }
  175. void set_service_workers_mode(ServiceWorkersMode service_workers_mode) { m_service_workers_mode = service_workers_mode; }
  176. [[nodiscard]] Optional<Initiator> const& initiator() const { return m_initiator; }
  177. void set_initiator(Optional<Initiator> initiator) { m_initiator = move(initiator); }
  178. [[nodiscard]] Optional<Destination> const& destination() const { return m_destination; }
  179. void set_destination(Optional<Destination> destination) { m_destination = move(destination); }
  180. [[nodiscard]] Priority const& priority() const { return m_priority; }
  181. void set_priority(Priority priority) { m_priority = priority; }
  182. [[nodiscard]] OriginType const& origin() const { return m_origin; }
  183. void set_origin(OriginType origin) { m_origin = move(origin); }
  184. [[nodiscard]] PolicyContainerType const& policy_container() const { return m_policy_container; }
  185. void set_policy_container(PolicyContainerType policy_container) { m_policy_container = move(policy_container); }
  186. [[nodiscard]] Mode mode() const { return m_mode; }
  187. void set_mode(Mode mode) { m_mode = mode; }
  188. [[nodiscard]] bool use_cors_preflight() const { return m_use_cors_preflight; }
  189. void set_use_cors_preflight(bool use_cors_preflight) { m_use_cors_preflight = use_cors_preflight; }
  190. [[nodiscard]] CredentialsMode credentials_mode() const { return m_credentials_mode; }
  191. void set_credentials_mode(CredentialsMode credentials_mode) { m_credentials_mode = credentials_mode; }
  192. [[nodiscard]] bool use_url_credentials() const { return m_use_url_credentials; }
  193. void set_use_url_credentials(bool use_url_credentials) { m_use_url_credentials = use_url_credentials; }
  194. [[nodiscard]] CacheMode cache_mode() const { return m_cache_mode; }
  195. void set_cache_mode(CacheMode cache_mode) { m_cache_mode = cache_mode; }
  196. [[nodiscard]] RedirectMode redirect_mode() const { return m_redirect_mode; }
  197. void set_redirect_mode(RedirectMode redirect_mode) { m_redirect_mode = redirect_mode; }
  198. [[nodiscard]] String const& integrity_metadata() const { return m_integrity_metadata; }
  199. void set_integrity_metadata(String integrity_metadata) { m_integrity_metadata = move(integrity_metadata); }
  200. [[nodiscard]] String const& cryptographic_nonce_metadata() const { return m_cryptographic_nonce_metadata; }
  201. void set_cryptographic_nonce_metadata(String cryptographic_nonce_metadata) { m_cryptographic_nonce_metadata = move(cryptographic_nonce_metadata); }
  202. [[nodiscard]] Optional<ParserMetadata> const& parser_metadata() const { return m_parser_metadata; }
  203. void set_parser_metadata(Optional<ParserMetadata> parser_metadata) { m_parser_metadata = move(parser_metadata); }
  204. [[nodiscard]] bool reload_navigation() const { return m_reload_navigation; }
  205. void set_reload_navigation(bool reload_navigation) { m_reload_navigation = reload_navigation; }
  206. [[nodiscard]] bool history_navigation() const { return m_history_navigation; }
  207. void set_history_navigation(bool history_navigation) { m_history_navigation = history_navigation; }
  208. [[nodiscard]] bool user_activation() const { return m_user_activation; }
  209. void set_user_activation(bool user_activation) { m_user_activation = user_activation; }
  210. [[nodiscard]] bool render_blocking() const { return m_render_blocking; }
  211. void set_render_blocking(bool render_blocking) { m_render_blocking = render_blocking; }
  212. [[nodiscard]] Vector<AK::URL> const& url_list() const { return m_url_list; }
  213. [[nodiscard]] Vector<AK::URL>& url_list() { return m_url_list; }
  214. void set_url_list(Vector<AK::URL> url_list) { m_url_list = move(url_list); }
  215. [[nodiscard]] u8 redirect_count() const { return m_redirect_count; }
  216. void set_redirect_count(u8 redirect_count) { m_redirect_count = redirect_count; }
  217. [[nodiscard]] ReferrerType const& referrer() const { return m_referrer; }
  218. void set_referrer(ReferrerType referrer) { m_referrer = move(referrer); }
  219. [[nodiscard]] Optional<ReferrerPolicy::ReferrerPolicy> const& referrer_policy() const { return m_referrer_policy; }
  220. void set_referrer_policy(Optional<ReferrerPolicy::ReferrerPolicy> referrer_policy) { m_referrer_policy = move(referrer_policy); }
  221. [[nodiscard]] ResponseTainting response_tainting() const { return m_response_tainting; }
  222. void set_response_tainting(ResponseTainting response_tainting) { m_response_tainting = response_tainting; }
  223. [[nodiscard]] bool prevent_no_cache_cache_control_header_modification() const { return m_prevent_no_cache_cache_control_header_modification; }
  224. void set_prevent_no_cache_cache_control_header_modification(bool prevent_no_cache_cache_control_header_modification) { m_prevent_no_cache_cache_control_header_modification = prevent_no_cache_cache_control_header_modification; }
  225. [[nodiscard]] bool done() const { return m_done; }
  226. void set_done(bool done) { m_done = done; }
  227. [[nodiscard]] bool timing_allow_failed() const { return m_timing_allow_failed; }
  228. void set_timing_allow_failed(bool timing_allow_failed) { m_timing_allow_failed = timing_allow_failed; }
  229. [[nodiscard]] AK::URL& url();
  230. [[nodiscard]] AK::URL const& url() const;
  231. [[nodiscard]] AK::URL& current_url();
  232. [[nodiscard]] AK::URL const& current_url() const;
  233. void set_url(AK::URL url);
  234. [[nodiscard]] bool destination_is_script_like() const;
  235. [[nodiscard]] bool is_subresource_request() const;
  236. [[nodiscard]] bool is_non_subresource_request() const;
  237. [[nodiscard]] bool is_navigation_request() const;
  238. [[nodiscard]] bool has_redirect_tainted_origin() const;
  239. [[nodiscard]] ErrorOr<String> serialize_origin() const;
  240. [[nodiscard]] ErrorOr<ByteBuffer> byte_serialize_origin() const;
  241. [[nodiscard]] JS::NonnullGCPtr<Request> clone(JS::Realm&) const;
  242. [[nodiscard]] ErrorOr<void> add_range_header(u64 first, Optional<u64> const& last);
  243. [[nodiscard]] ErrorOr<void> add_origin_header();
  244. [[nodiscard]] bool cross_origin_embedder_policy_allows_credentials() const;
  245. // Non-standard
  246. void add_pending_response(Badge<Fetching::PendingResponse>, JS::NonnullGCPtr<Fetching::PendingResponse> pending_response)
  247. {
  248. VERIFY(!m_pending_responses.contains_slow(pending_response));
  249. m_pending_responses.append(pending_response);
  250. }
  251. void remove_pending_response(Badge<Fetching::PendingResponse>, JS::NonnullGCPtr<Fetching::PendingResponse> pending_response)
  252. {
  253. m_pending_responses.remove_first_matching([&](auto gc_ptr) { return gc_ptr == pending_response; });
  254. }
  255. private:
  256. explicit Request(JS::NonnullGCPtr<HeaderList>);
  257. virtual void visit_edges(JS::Cell::Visitor&) override;
  258. // https://fetch.spec.whatwg.org/#concept-request-method
  259. // A request has an associated method (a method). Unless stated otherwise it is `GET`.
  260. ByteBuffer m_method { ByteBuffer::copy("GET"sv.bytes()).release_value() };
  261. // https://fetch.spec.whatwg.org/#local-urls-only-flag
  262. // A request has an associated local-URLs-only flag. Unless stated otherwise it is unset.
  263. bool m_local_urls_only { false };
  264. // https://fetch.spec.whatwg.org/#concept-request-header-list
  265. // A request has an associated header list (a header list). Unless stated otherwise it is empty.
  266. JS::NonnullGCPtr<HeaderList> m_header_list;
  267. // https://fetch.spec.whatwg.org/#unsafe-request-flag
  268. // A request has an associated unsafe-request flag. Unless stated otherwise it is unset.
  269. bool m_unsafe_request { false };
  270. // https://fetch.spec.whatwg.org/#concept-request-body
  271. // A request has an associated body (null, a byte sequence, or a body). Unless stated otherwise it is null.
  272. BodyType m_body;
  273. // https://fetch.spec.whatwg.org/#concept-request-client
  274. // A request has an associated client (null or an environment settings object).
  275. JS::GCPtr<HTML::EnvironmentSettingsObject> m_client;
  276. // https://fetch.spec.whatwg.org/#concept-request-reserved-client
  277. // A request has an associated reserved client (null, an environment, or an environment settings object). Unless
  278. // stated otherwise it is null.
  279. ReservedClientType m_reserved_client;
  280. // https://fetch.spec.whatwg.org/#concept-request-replaces-client-id
  281. // A request has an associated replaces client id (a string). Unless stated otherwise it is the empty string.
  282. String m_replaces_client_id;
  283. // https://fetch.spec.whatwg.org/#concept-request-window
  284. // A request has an associated window ("no-window", "client", or an environment settings object whose global object
  285. // is a Window object). Unless stated otherwise it is "client".
  286. WindowType m_window { Window::Client };
  287. // https://fetch.spec.whatwg.org/#request-keepalive-flag
  288. // A request has an associated boolean keepalive. Unless stated otherwise it is false.
  289. bool m_keepalive { false };
  290. // https://fetch.spec.whatwg.org/#request-initiator-type
  291. // A request has an associated initiator type, which is null, "audio", "beacon", "body", "css", "early-hint",
  292. // "embed", "fetch", "font", "frame", "iframe", "image", "img", "input", "link", "object", "ping", "script",
  293. // "track", "video", "xmlhttprequest", or "other". Unless stated otherwise it is null. [RESOURCE-TIMING]
  294. Optional<InitiatorType> m_initiator_type;
  295. // https://fetch.spec.whatwg.org/#request-service-workers-mode
  296. // A request has an associated service-workers mode, that is "all" or "none". Unless stated otherwise it is "all".
  297. ServiceWorkersMode m_service_workers_mode { ServiceWorkersMode::All };
  298. // https://fetch.spec.whatwg.org/#concept-request-initiator
  299. // A request has an associated initiator, which is the empty string, "download", "imageset", "manifest",
  300. // "prefetch", "prerender", or "xslt". Unless stated otherwise it is the empty string.
  301. Optional<Initiator> m_initiator;
  302. // https://fetch.spec.whatwg.org/#concept-request-destination
  303. // A request has an associated destination, which is the empty string, "audio", "audioworklet", "document",
  304. // "embed", "font", "frame", "iframe", "image", "manifest", "object", "paintworklet", "report", "script",
  305. // "serviceworker", "sharedworker", "style", "track", "video", "webidentity", "worker", or "xslt". Unless stated
  306. // otherwise it is the empty string.
  307. // NOTE: These are reflected on RequestDestination except for "serviceworker" and "webidentity" as fetches with
  308. // those destinations skip service workers.
  309. Optional<Destination> m_destination;
  310. // https://fetch.spec.whatwg.org/#request-priority
  311. // A request has an associated priority, which is "high", "low", or "auto". Unless stated otherwise it is "auto".
  312. Priority m_priority { Priority::Auto };
  313. // https://fetch.spec.whatwg.org/#request-internal-priority
  314. // A request has an associated internal priority (null or an implementation-defined object). Unless otherwise stated it is null.
  315. Optional<InternalPriority> m_internal_priority;
  316. // https://fetch.spec.whatwg.org/#concept-request-origin
  317. // A request has an associated origin, which is "client" or an origin. Unless stated otherwise it is "client".
  318. OriginType m_origin { Origin::Client };
  319. // https://fetch.spec.whatwg.org/#concept-request-policy-container
  320. // A request has an associated policy container, which is "client" or a policy container. Unless stated otherwise
  321. // it is "client".
  322. PolicyContainerType m_policy_container { PolicyContainer::Client };
  323. // https://fetch.spec.whatwg.org/#concept-request-referrer
  324. // A request has an associated referrer, which is "no-referrer", "client", or a URL. Unless stated otherwise it is
  325. // "client".
  326. ReferrerType m_referrer { Referrer::Client };
  327. // https://fetch.spec.whatwg.org/#concept-request-referrer-policy
  328. // A request has an associated referrer policy, which is a referrer policy. Unless stated otherwise it is the empty
  329. // string.
  330. Optional<ReferrerPolicy::ReferrerPolicy> m_referrer_policy;
  331. // https://fetch.spec.whatwg.org/#concept-request-mode
  332. // A request has an associated mode, which is "same-origin", "cors", "no-cors", "navigate", or "websocket". Unless
  333. // stated otherwise, it is "no-cors".
  334. Mode m_mode { Mode::NoCORS };
  335. // https://fetch.spec.whatwg.org/#use-cors-preflight-flag
  336. // A request has an associated use-CORS-preflight flag. Unless stated otherwise, it is unset.
  337. bool m_use_cors_preflight { false };
  338. // https://fetch.spec.whatwg.org/#concept-request-credentials-mode
  339. // A request has an associated credentials mode, which is "omit", "same-origin", or "include". Unless stated
  340. // otherwise, it is "same-origin".
  341. CredentialsMode m_credentials_mode { CredentialsMode::SameOrigin };
  342. // https://fetch.spec.whatwg.org/#concept-request-use-url-credentials-flag
  343. // A request has an associated use-URL-credentials flag. Unless stated otherwise, it is unset.
  344. // NOTE: When this flag is set, when a request’s URL has a username and password, and there is an available
  345. // authentication entry for the request, then the URL’s credentials are preferred over that of the
  346. // authentication entry. Modern specifications avoid setting this flag, since putting credentials in URLs is
  347. // discouraged, but some older features set it for compatibility reasons.
  348. bool m_use_url_credentials { false };
  349. // https://fetch.spec.whatwg.org/#concept-request-cache-mode
  350. // A request has an associated cache mode, which is "default", "no-store", "reload", "no-cache", "force-cache", or
  351. // "only-if-cached". Unless stated otherwise, it is "default".
  352. CacheMode m_cache_mode { CacheMode::Default };
  353. // https://fetch.spec.whatwg.org/#concept-request-redirect-mode
  354. // A request has an associated redirect mode, which is "follow", "error", or "manual". Unless stated otherwise, it
  355. // is "follow".
  356. RedirectMode m_redirect_mode { RedirectMode::Follow };
  357. // https://fetch.spec.whatwg.org/#concept-request-integrity-metadata
  358. // A request has associated integrity metadata (a string). Unless stated otherwise, it is the empty string.
  359. String m_integrity_metadata;
  360. // https://fetch.spec.whatwg.org/#concept-request-nonce-metadata
  361. // A request has associated cryptographic nonce metadata (a string). Unless stated otherwise, it is the empty
  362. // string.
  363. String m_cryptographic_nonce_metadata;
  364. // https://fetch.spec.whatwg.org/#concept-request-parser-metadata
  365. // A request has associated parser metadata which is the empty string, "parser-inserted", or
  366. // "not-parser-inserted". Unless otherwise stated, it is the empty string.
  367. Optional<ParserMetadata> m_parser_metadata;
  368. // https://fetch.spec.whatwg.org/#concept-request-reload-navigation-flag
  369. // A request has an associated reload-navigation flag. Unless stated otherwise, it is unset.
  370. bool m_reload_navigation { false };
  371. // https://fetch.spec.whatwg.org/#concept-request-history-navigation-flag
  372. // A request has an associated history-navigation flag. Unless stated otherwise, it is unset.
  373. bool m_history_navigation { false };
  374. // https://fetch.spec.whatwg.org/#request-user-activation
  375. // A request has an associated boolean user-activation. Unless stated otherwise, it is false.
  376. bool m_user_activation { false };
  377. // https://fetch.spec.whatwg.org/#request-render-blocking
  378. // A request has an associated boolean render-blocking. Unless stated otherwise, it is false.
  379. bool m_render_blocking { false };
  380. // https://fetch.spec.whatwg.org/#concept-request-url-list
  381. // A request has an associated URL list (a list of one or more URLs). Unless stated otherwise, it is a list
  382. // containing a copy of request’s URL.
  383. Vector<AK::URL> m_url_list;
  384. // https://fetch.spec.whatwg.org/#concept-request-redirect-count
  385. // A request has an associated redirect count. Unless stated otherwise, it is zero.
  386. // NOTE: '4.4. HTTP-redirect fetch' infers a limit of 20.
  387. u8 m_redirect_count { 0 };
  388. // https://fetch.spec.whatwg.org/#concept-request-response-tainting
  389. // A request has an associated response tainting, which is "basic", "cors", or "opaque". Unless stated otherwise,
  390. // it is "basic".
  391. ResponseTainting m_response_tainting { ResponseTainting::Basic };
  392. // https://fetch.spec.whatwg.org/#no-cache-prevent-cache-control
  393. // A request has an associated prevent no-cache cache-control header modification flag. Unless stated otherwise, it
  394. // is unset.
  395. bool m_prevent_no_cache_cache_control_header_modification { false };
  396. // https://fetch.spec.whatwg.org/#done-flag
  397. // A request has an associated done flag. Unless stated otherwise, it is unset.
  398. bool m_done { false };
  399. // https://fetch.spec.whatwg.org/#timing-allow-failed
  400. // A request has an associated timing allow failed flag. Unless stated otherwise, it is unset.
  401. bool m_timing_allow_failed { false };
  402. // Non-standard
  403. Vector<JS::NonnullGCPtr<Fetching::PendingResponse>> m_pending_responses;
  404. };
  405. }