Fix horrible bug that exposes information about a registered host

Thank you @asterix11 for pointing this out.
This commit is contained in:
Philipp Böhm 2018-02-11 21:20:47 +01:00
parent 2223aca4b6
commit ffe0092e41
1 changed files with 2 additions and 4 deletions

View File

@ -60,10 +60,8 @@ func (f *Frontend) Run() error {
var err error
if h, err := f.hosts.GetHost(hostname); err == nil {
c.JSON(403, gin.H{
"error": fmt.Sprintf("This hostname has already been registered. %v", h),
})
if _, err := f.hosts.GetHost(hostname); err == nil {
c.JSON(403, gin.H{"error": "This hostname has already been registered."})
return
}