mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-14 19:21:46 +03:00
Check for response status when fetching credentials
This commit is contained in:
parent
168b33d5d5
commit
0aff72059b
@ -84,6 +84,11 @@ func ConnectWithBackend(c *gin.Context) {
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != 200 {
|
||||
c.JSON(400, Error{"Unable to fetch connection settings"})
|
||||
return
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
c.JSON(400, err)
|
||||
|
Loading…
Reference in New Issue
Block a user