diff --git a/AK/URL.cpp b/AK/URL.cpp index 64f89e7479..8ecf1313d5 100644 --- a/AK/URL.cpp +++ b/AK/URL.cpp @@ -72,6 +72,11 @@ DeprecatedString URL::fragment() const return percent_decode(m_fragment); } +DeprecatedString URL::raw_fragment() const +{ + return m_fragment; +} + // NOTE: This only exists for compatibility with the existing URL tests which check for both .is_null() and .is_empty(). static DeprecatedString deprecated_string_percent_encode(DeprecatedString const& input, URL::PercentEncodeSet set = URL::PercentEncodeSet::Userinfo, URL::SpaceAsPlus space_as_plus = URL::SpaceAsPlus::No) { diff --git a/AK/URL.h b/AK/URL.h index de47383990..bf7a636475 100644 --- a/AK/URL.h +++ b/AK/URL.h @@ -83,7 +83,9 @@ public: ErrorOr serialized_host() const; DeprecatedString basename() const; DeprecatedString query() const; + // NOTE: fragment() is percent-decoded, raw_fragment() is not. DeprecatedString fragment() const; + DeprecatedString raw_fragment() const; Optional port() const { return m_port; } DeprecatedString path_segment_at_index(size_t index) const; size_t path_segment_count() const { return m_paths.size(); }