What is going wrong here? I am 100% sure I am sending a HTTP POST request, but somehow the OR operator is not working as I am expecting. In the first example the server returns a 405 and in the second example the code continues executing.
not working:
if req.Method != http.MethodPost || req.Method != http.MethodDelete {
http.Error(res, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
return
}
working:
if req.Method != http.MethodPost {
http.Error(res, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
return
}