CORSSettingAttribute.h 658 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (c) 2023, Srikavin Ramkumar <me@srikavin.me>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Optional.h>
  8. #include <AK/String.h>
  9. #include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
  10. namespace Web::HTML {
  11. // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attribute
  12. enum class CORSSettingAttribute {
  13. NoCORS,
  14. Anonymous,
  15. UseCredentials
  16. };
  17. [[nodiscard]] CORSSettingAttribute cors_setting_attribute_from_keyword(Optional<String> const& keyword);
  18. [[nodiscard]] Fetch::Infrastructure::Request::CredentialsMode cors_settings_attribute_credentials_mode(CORSSettingAttribute);
  19. }