1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:47:35 +00:00

LibWeb: Add Origin::is_same(const Origin&)

Getting ready for some extremely basic same-origin policy stuff,
this initial implementation simply checks that two origins have
identical protocol, host and port.
This commit is contained in:
Andreas Kling 2020-09-22 18:25:48 +02:00
parent b4a3537716
commit 4c1f317572

View file

@ -46,6 +46,13 @@ public:
const String& host() const { return m_host; } const String& host() const { return m_host; }
u16 port() const { return m_port; } u16 port() const { return m_port; }
bool is_same(const Origin& other) const
{
return protocol() == other.protocol()
&& host() == other.host()
&& port() == other.port();
}
private: private:
String m_protocol; String m_protocol;
String m_host; String m_host;