From d8d1fc36790773051839890878b3e6b9efbdb960 Mon Sep 17 00:00:00 2001 From: Jannover5000r <90698896+Jannover5000r@users.noreply.github.com> Date: Mon, 16 Jun 2025 23:11:42 +0200 Subject: [PATCH] as --- Bot/Untis.go | 8 +++++--- main.go | 16 ++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Bot/Untis.go b/Bot/Untis.go index 638e836..e46e7d0 100644 --- a/Bot/Untis.go +++ b/Bot/Untis.go @@ -44,13 +44,15 @@ func Auth() { } log.Println("Run") - res, err := http.Post(Url, "application/json", login) + LoginOut, err := http.Post(Url, "application/json", login) if err != nil { log.Printf("Error during authentication: %v", err) return } - log.Println(res) - log.Println("") + defer LoginOut.Body.Close() + out := LoginOut.Header.Values("Set-Cookie") + + log.Println(out) } diff --git a/main.go b/main.go index 7f80959..cf43001 100644 --- a/main.go +++ b/main.go @@ -9,8 +9,8 @@ import ( "net/http" "os" - // "os/signal" - // "syscall" + "os/signal" + "syscall" "time" Untis "untislogger/Bot" @@ -45,14 +45,14 @@ func init() { func main() { go Untis.Auth() //starting API calls function // Create a channel to receive OS signals - /* sigChan := make(chan os.Signal, 1) - signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) + sigChan := make(chan os.Signal, 1) + signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) - log.Println("Program is running. Press Ctrl+C to stop.") + log.Println("Program is running. Press Ctrl+C to stop.") - // Block until we receive a signal - <-sigChan - log.Println("Shutting down...") */ + // Block until we receive a signal + <-sigChan + log.Println("Shutting down...") } func testPubIP() {