summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/XHR
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-09-13 23:12:16 +0300
committerAndreas Kling <kling@serenityos.org>2021-09-14 00:14:45 +0200
commitd6cfa34667fe808975279c237d4ac9fe612631d8 (patch)
tree76a873fbbd1af254048bc4b1104c72cd589df34b /Userland/Libraries/LibWeb/XHR
parent1c9c43785d0f3b810e581a6d3267e52f566733b4 (diff)
downloadserenity-d6cfa34667fe808975279c237d4ac9fe612631d8.zip
AK: Make URL::m_port an Optional<u16>, Expose raw port getter
Our current way of signalling a missing port with m_port == 0 was lacking, as 0 is a valid port number in URLs.
Diffstat (limited to 'Userland/Libraries/LibWeb/XHR')
-rw-r--r--Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
index 143fe1c9c6..339e11b0ad 100644
--- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
+++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
@@ -171,7 +171,7 @@ DOM::ExceptionOr<void> XMLHttpRequest::send()
dbgln("XHR send from {} to {}", m_window->associated_document().url(), request_url);
// TODO: Add support for preflight requests to support CORS requests
- Origin request_url_origin = Origin(request_url.protocol(), request_url.host(), request_url.port());
+ Origin request_url_origin = Origin(request_url.protocol(), request_url.host(), request_url.port_or_default());
bool should_enforce_same_origin_policy = true;
if (auto* page = m_window->page())