Procházet zdrojové kódy

Add check protocol qrcode

marinofaggiana před 6 roky
rodič
revize
fadec0dc2b
1 změnil soubory, kde provedl 5 přidání a 0 odebrání
  1. 5 0
      iOSClient/Login/CCLogin.m

+ 5 - 0
iOSClient/Login/CCLogin.m

@@ -279,6 +279,11 @@
             self.password.text = [valueArray[1] stringByReplacingOccurrencesOfString:@"password:" withString:@""];
             self.baseUrl.text = [valueArray[2] stringByReplacingOccurrencesOfString:@"server:" withString:@""];
             
+            // Check whether baseUrl contain protocol. If not add https:// by default.
+            if(![self.baseUrl.text hasPrefix:@"https"] && ![self.baseUrl.text hasPrefix:@"http"]) {
+                self.baseUrl.text = [NSString stringWithFormat:@"https://%@",self.baseUrl.text];
+            }
+            
             [self handleButtonLogin:self];
         }
     }