From 8e2d654b407e276bd3aad9a46f3b65859518b1d8 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 31 Jul 2017 12:30:05 -0400 Subject: [PATCH] fix url if malformed --- src/iOS.Extension/Models/Context.cs | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/iOS.Extension/Models/Context.cs b/src/iOS.Extension/Models/Context.cs index 447965c06..fe6c6fa81 100644 --- a/src/iOS.Extension/Models/Context.cs +++ b/src/iOS.Extension/Models/Context.cs @@ -1,12 +1,11 @@ using System; -using Bit.App.Models; using Foundation; namespace Bit.iOS.Extension.Models { public class Context { - private DomainName _domainName; + private string _uriString; public NSExtensionContext ExtContext { get; set; } public string ProviderType { get; set; } @@ -23,7 +22,24 @@ namespace Bit.iOS.Extension.Models return uri; } } - public string UrlString { get; set; } + public string UrlString + { + get + { + return _uriString; + } + set + { + _uriString = value; + if(_uriString != null && _uriString.Contains(".")) + { + if(!_uriString.Contains("://") && !_uriString.Contains(" ")) + { + _uriString = string.Concat("http://", _uriString); + } + } + } + } public string LoginTitle { get; set; } public string Username { get; set; } public string Password { get; set; }