32 lines
601 B
Go
32 lines
601 B
Go
|
package checks
|
||
|
|
||
|
import (
|
||
|
"io/ioutil"
|
||
|
"log"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
func (c *Checks) CheckGit(domain string) {
|
||
|
url := "https://" + domain + "/.git/HEAD"
|
||
|
res, err := c.get(url)
|
||
|
if err != nil {
|
||
|
//log.Println(domain + " error: " + err.Error())
|
||
|
return
|
||
|
}
|
||
|
|
||
|
bbody, err := ioutil.ReadAll(res.Body)
|
||
|
if err != nil {
|
||
|
//log.Println(domain + " read error: " + err.Error())
|
||
|
return
|
||
|
}
|
||
|
|
||
|
body := string(bbody)
|
||
|
|
||
|
if strings.HasPrefix(body, "ref:") {
|
||
|
c.Message("znalazło debila\n" + url + "\n\n" + body)
|
||
|
log.Println("DEBIL " + url)
|
||
|
} else {
|
||
|
//log.Println(domain + " size: " + strconv.Itoa(len(body)))
|
||
|
}
|
||
|
}
|