Remove TODOs for various URL hits, PHPSESSID verification

This commit is contained in:
2023-12-15 06:13:56 -06:00
parent 490cd9c911
commit f42798f498

15
api.go
View File

@@ -6,6 +6,7 @@ import (
"net/http" "net/http"
"net/http/cookiejar" "net/http/cookiejar"
"regexp" "regexp"
"slices"
"strconv" "strconv"
"time" "time"
@@ -62,12 +63,16 @@ func reload(name string) {
res, _ = client.Do(req) res, _ = client.Do(req)
onResponse(res) onResponse(res)
// TODO: Verify that a PHPSESSID cookie is present // Verify that a PHPSESSID cookie is present
site_cookies := client.Jar.Cookies(req.URL)
has_php_session := slices.ContainsFunc(site_cookies, func(cookie *http.Cookie) bool {
return cookie.Name == "PHPSESSID"
})
if len(name) > 0 { if !has_php_session {
// TODO: GET https://www.register2park.com/register-get-properties-from-name log.Fatal("PHPSESSID cookie not found")
// TODO: GET https://www.register2park.com/register?key=678zv9zzylvw } else {
// TODO: GET https://www.register2park.com/register-get-properties-from-name log.Println("PHPSESSID cookie found")
} }
} }