package handler import ( "fmt" "net/http" "git.0x0001f346.de/andreas/clickNgo/core" ) func POSTFlashAdd(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost { http.Error(w, "405 Method Not Allowed", http.StatusMethodNotAllowed) return } r.ParseForm() URLs := core.ExtractURLsFromString(r.PostFormValue("urls")) if len(URLs) == 0 { http.Error(w, "400 Bad Request", http.StatusBadRequest) return } printURLs(URLs) fmt.Fprintln(w, "OK") } func POSTFlashAddcrypted2(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost { http.Error(w, "405 Method Not Allowed", http.StatusMethodNotAllowed) return } r.ParseForm() URLs, err := core.DecryptURLs(r.PostFormValue("jk"), r.PostFormValue("crypted")) if err != nil || len(URLs) == 0 { http.Error(w, "400 Bad Request", http.StatusBadRequest) return } printURLs(URLs) fmt.Fprintln(w, "OK") } func printURLs(URLs []string) { for _, url := range URLs { fmt.Println(url) } fmt.Println("") }