1
0
Fork 0

Merge pull request #142 from rqlite/proper-methods

Ensure the correct HTTP methods on endpoints
master
Philip O'Toole 8 years ago
commit 6aa81fcdd0

@ -1,4 +1,5 @@
## 3.2.0 (Unreleased)
- [PR #142](https://github.com/rqlite/rqlite/pull/142): Use correct HTTP methods on all endpoints.
- [PR #137](https://github.com/rqlite/rqlite/pull/137): Use resolved version of joining node's address.
- [PR #136](https://github.com/rqlite/rqlite/pull/136): Better errors on join failures.
- [PR #133](https://github.com/rqlite/rqlite/pull/133): Add Peers to status output.

@ -229,6 +229,11 @@ func (s *Service) handleJoin(w http.ResponseWriter, r *http.Request) {
return
}
if r.Method != "POST" {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
b, err := ioutil.ReadAll(r.Body)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
@ -266,6 +271,11 @@ func (s *Service) handleRemove(w http.ResponseWriter, r *http.Request) {
return
}
if r.Method != "POST" {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
b, err := ioutil.ReadAll(r.Body)
if err != nil {
w.WriteHeader(http.StatusBadRequest)

Loading…
Cancel
Save