Format and validate connection url on /api/connect endpoint
This commit is contained in:
parent
5f7b18fe0e
commit
00fa57d9c4
8
api.go
8
api.go
@ -79,6 +79,14 @@ func API_Connect(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts := Options{Url: url}
|
||||||
|
url, err := formatConnectionUrl(opts)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(400, Error{err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
client, err := NewClientFromUrl(url)
|
client, err := NewClientFromUrl(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(400, Error{err.Error()})
|
c.JSON(400, Error{err.Error()})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user