diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2022-04-09 15:48:55 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-09 14:36:28 +0200 |
commit | b16918ccb9c20cdaf8cae79699e401fba6ffe685 (patch) | |
tree | 48f41888c2b46d60cbc011426c82274cebd873c6 /Userland | |
parent | a42e03b01a7c2c98377f3851cb4e5f07d7e3ba35 (diff) | |
download | serenity-b16918ccb9c20cdaf8cae79699e401fba6ffe685.zip |
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.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Utilities/pro.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Utilities/pro.cpp b/Userland/Utilities/pro.cpp index 123b1d11fe..93201b0f26 100644 --- a/Userland/Utilities/pro.cpp +++ b/Userland/Utilities/pro.cpp @@ -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; |