1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

Everywhere: Replace a bundle of dbg with dbgln.

These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
This commit is contained in:
asynts 2021-01-12 14:11:44 +01:00 committed by Andreas Kling
parent 6b7602d33b
commit adbb8d62d1
6 changed files with 18 additions and 18 deletions

View file

@ -73,13 +73,13 @@ void XMLHttpRequest::open(const String& method, const String& url)
void XMLHttpRequest::send()
{
URL request_url = m_window->document().complete_url(m_url);
dbg() << "XHR send from " << m_window->document().url() << " to " << request_url;
dbgln("XHR send from {} to {}", m_window->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());
if (!m_window->document().origin().is_same(request_url_origin)) {
dbg() << "XHR failed to load: Same-Origin Policy violation: " << m_window->document().url() << " may not load " << request_url;
dbgln("XHR failed to load: Same-Origin Policy violation: {} may not load {}", m_window->document().url(), request_url);
auto weak_this = make_weak_ptr();
if (!weak_this)
return;
@ -102,7 +102,7 @@ void XMLHttpRequest::send()
[weak_this = make_weak_ptr()](auto& error) {
if (!weak_this)
return;
dbg() << "XHR failed to load: " << error;
dbgln("XHR failed to load: {}", error);
const_cast<XMLHttpRequest&>(*weak_this).set_ready_state(ReadyState::Done);
const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create(HTML::EventNames::error));
});