Skip to content

Commit

Permalink
Make it buildable under 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekmm committed Apr 17, 2016
1 parent 32a8d8f commit 1625aee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions messenger.go
Expand Up @@ -26,15 +26,15 @@ type Messenger struct {
}

func (m *Messenger) Handler(rw http.ResponseWriter, req *http.Request) {
if req.Method == http.MethodGet {
if req.Method == "GET" {
query := req.URL.Query()
if query.Get("hub.verify_token") != m.VerifyToken {
rw.WriteHeader(http.StatusUnauthorized)
return
}
rw.WriteHeader(http.StatusOK)
rw.Write([]byte(query.Get("hub.challenge")))
} else if req.Method == http.MethodPost {
} else if req.Method == "POST" {
read, err := ioutil.ReadAll(req.Body)
if err != nil {
rw.WriteHeader(http.StatusBadRequest)
Expand Down
2 changes: 1 addition & 1 deletion welcomemessage.go
Expand Up @@ -36,7 +36,7 @@ func (m *Messenger) SetWelcomeMessage(message *Message) error {
if err != nil {
return err
}
resp, err := m.doRequest(http.MethodPost, fmt.Sprintf("https://graph.facebook.com/v2.6/%s/thread_settings", m.PageID), bytes.NewReader(byt))
resp, err := m.doRequest("POST", fmt.Sprintf("https://graph.facebook.com/v2.6/%s/thread_settings", m.PageID), bytes.NewReader(byt))
if err != nil {
return err
}
Expand Down

0 comments on commit 1625aee

Please sign in to comment.