mirror of
https://code.dumpstack.io/tools/wi.git
synced 2024-11-17 13:52:40 +00:00
Add to history after success request
This commit is contained in:
parent
6c56bb9e2f
commit
d4a5ae0b1b
4
main.go
4
main.go
|
@ -91,8 +91,6 @@ func parseLinks(db *sql.DB, body []byte, req *http.Request) (htmlPage string, er
|
||||||
}
|
}
|
||||||
|
|
||||||
func cmd_url(db *sql.DB, url string) {
|
func cmd_url(db *sql.DB, url string) {
|
||||||
storage.AddHistoryURL(db, url)
|
|
||||||
|
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
|
|
||||||
// TODO Full url encoding
|
// TODO Full url encoding
|
||||||
|
@ -108,6 +106,8 @@ func cmd_url(db *sql.DB, url string) {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
storage.AddHistoryURL(db, url)
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
utf8, err := charset.NewReader(resp.Body, resp.Header.Get("Content-Type"))
|
utf8, err := charset.NewReader(resp.Body, resp.Header.Get("Content-Type"))
|
||||||
|
|
Loading…
Reference in a new issue