Skip to content

Commit 40e70ac

Browse files
author
Johannes Duesing
committed
Fixed protocol check using 'contains' instead of 'startsWith'.
1 parent 91a49db commit 40e70ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/utils/CommonHelper.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ object CommonHelper {
2020
val configuration: Configuration = new Configuration()
2121

2222
def addHttpProtocolIfNotExist(url: String): String = {
23-
val exist = url.contains("http://") || url.contains("https://")
24-
if(! exist) {
23+
val hasProtocol = url.startsWith("http://") || url.startsWith("https://")
24+
if(! hasProtocol) {
2525
"http://" + url //Default protocol is http
2626
} else {
2727
url

0 commit comments

Comments
 (0)