pro: Only attempt to parse a proxy url if it is provided

Otherwise we'd end up trying to parse an empty string as a proxy url
which is certainly not one.
This commit is contained in:
Ali Mohammad Pur 2022-04-09 15:48:55 +04:30 committed by Andreas Kling
parent a42e03b01a
commit b16918ccb9
Notes: sideshowbarker 2024-07-17 14:14:47 +09:00

View file

@ -191,7 +191,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return 1;
}
Core::ProxyData proxy_data = TRY(Core::ProxyData::parse_url(proxy_spec));
Core::ProxyData proxy_data {};
if (!proxy_spec.is_empty())
proxy_data = TRY(Core::ProxyData::parse_url(proxy_spec));
Core::EventLoop loop;
bool received_actual_headers = false;