Ver código fonte

empty strings don't have server names

David Rose 23 anos atrás
pai
commit
eaf400490d
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      panda/src/downloader/urlSpec.cxx

+ 5 - 0
panda/src/downloader/urlSpec.cxx

@@ -374,6 +374,11 @@ set_url(const string &url, bool server_name_expected) {
   _url = url;
   _url = url;
   _flags = 0;
   _flags = 0;
 
 
+  if (url.empty()) {
+    // No server name on an empty string.
+    server_name_expected = false;
+  }
+
   // First, replace backslashes with forward slashes, since this is a
   // First, replace backslashes with forward slashes, since this is a
   // common mistake among Windows users.
   // common mistake among Windows users.
   size_t p;
   size_t p;