File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Coder-Desktop/Coder-Desktop/Views Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -194,8 +194,8 @@ func validateURL(_ url: String) throws(LoginError) -> URL {
194194 guard let url = URL ( string: url) else {
195195 throw . invalidURL
196196 }
197- guard url. scheme == " https " else {
198- throw . httpsRequired
197+ guard url. scheme == " https " || url . scheme == " http " else {
198+ throw . invalidScheme
199199 }
200200 guard url. host != nil else {
201201 throw . noHost
@@ -204,7 +204,7 @@ func validateURL(_ url: String) throws(LoginError) -> URL {
204204}
205205
206206enum LoginError : Error {
207- case httpsRequired
207+ case invalidScheme
208208 case noHost
209209 case invalidURL
210210 case outdatedCoderVersion
@@ -213,12 +213,12 @@ enum LoginError: Error {
213213
214214 var description : String {
215215 switch self {
216- case . httpsRequired :
217- " URL must use HTTPS "
216+ case . invalidScheme :
217+ " Coder URL must use HTTPS or HTTP "
218218 case . noHost:
219- " URL must have a host "
219+ " Coder URL must have a host"
220220 case . invalidURL:
221- " Invalid URL "
221+ " Invalid Coder URL "
222222 case . outdatedCoderVersion:
223223 """
224224 The Coder deployment must be version \( Validator . minimumCoderVersion)
You can’t perform that action at this time.
0 commit comments