Explorar el Código

Add check protocol qrcode

marinofaggiana hace 6 años
padre
commit
fadec0dc2b
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  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];
         }
     }