this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

✨ Prevent empty mails

+6
+6
main.go
··· 158 158 server.HandleFunc("/mail", func(w http.ResponseWriter, r *http.Request) { 159 159 if r.Method != http.MethodPost { 160 160 http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) 161 + return 161 162 } 162 163 163 164 subject := strings.TrimSpace(r.FormValue("subject")) 164 165 body := strings.TrimSpace(r.FormValue("body")) 165 166 from := strings.TrimSpace(r.FormValue("from")) 167 + 168 + if subject == "" || body == "" || from == "" { 169 + http.Error(w, "Missing fields", http.StatusBadRequest) 170 + return 171 + } 166 172 167 173 err := SendMailToSelf(from, subject, body) 168 174 if err != nil {