Explorar o código

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.
Ali Mohammad Pur %!s(int64=3) %!d(string=hai) anos
pai
achega
b16918ccb9
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      Userland/Utilities/pro.cpp

+ 3 - 1
Userland/Utilities/pro.cpp

@@ -191,7 +191,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
         return 1;
         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;
     Core::EventLoop loop;
     bool received_actual_headers = false;
     bool received_actual_headers = false;