Skip to content

Commit

Permalink
Go implementation to work (#7)
Browse files Browse the repository at this point in the history
I do not know how to fix it.
  • Loading branch information
catatsuy authored and Yusuke Kato committed Jun 20, 2018
1 parent 9c9e02d commit 6770f4c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webapp/go/isuwitter/app.go
Expand Up @@ -89,7 +89,7 @@ func htmlify(tweet string) string {
}

func loadFriends(name string) ([]string, error) {
resp, err := http.DefaultClient.Get(pathURIEscape(fmt.Sprintf("%s/%s", isutomoEndpoint, name)))
resp, err := http.DefaultClient.Get(isutomoEndpoint + pathURIEscape("/"+name))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -295,7 +295,7 @@ func followHandler(w http.ResponseWriter, r *http.Request) {
}

jsonStr := `{"user":"` + r.FormValue("user") + `"}`
req, err := http.NewRequest(http.MethodPost, pathURIEscape(isutomoEndpoint+"/"+userName), bytes.NewBuffer([]byte(jsonStr)))
req, err := http.NewRequest(http.MethodPost, isutomoEndpoint+pathURIEscape("/"+userName), bytes.NewBuffer([]byte(jsonStr)))

if err != nil {
badRequest(w)
Expand Down Expand Up @@ -329,7 +329,7 @@ func unfollowHandler(w http.ResponseWriter, r *http.Request) {
}

jsonStr := `{"user":"` + r.FormValue("user") + `"}`
req, err := http.NewRequest(http.MethodDelete, pathURIEscape(isutomoEndpoint+"/"+userName), bytes.NewBuffer([]byte(jsonStr)))
req, err := http.NewRequest(http.MethodDelete, isutomoEndpoint+pathURIEscape("/"+userName), bytes.NewBuffer([]byte(jsonStr)))

if err != nil {
badRequest(w)
Expand Down

0 comments on commit 6770f4c

Please sign in to comment.