aboutsummaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2020-01-04 18:56:47 +0000
committerr <r@freesoftwareextremist.com>2020-01-04 18:56:47 +0000
commit50e58c4e010959955286e4250ebacb3b93f8c525 (patch)
treecd09f7a81418e3a68ea78b5af02f825c9244eb19 /service
parente9bd72306e8ad1c7d17a5f1bd39bb6cb86d3ab19 (diff)
downloadbloat-50e58c4e010959955286e4250ebacb3b93f8c525.tar.gz
bloat-50e58c4e010959955286e4250ebacb3b93f8c525.zip
Use post method for like and retweet
Diffstat (limited to 'service')
-rw-r--r--service/transport.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/service/transport.go b/service/transport.go
index dc7e479..d481b21 100644
--- a/service/transport.go
+++ b/service/transport.go
@@ -167,7 +167,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
w.WriteHeader(http.StatusFound)
- }).Methods(http.MethodGet)
+ }).Methods(http.MethodPost)
r.HandleFunc("/unlike/{id}", func(w http.ResponseWriter, req *http.Request) {
ctx := getContextWithSession(context.Background(), req)
@@ -180,7 +180,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
w.WriteHeader(http.StatusFound)
- }).Methods(http.MethodGet)
+ }).Methods(http.MethodPost)
r.HandleFunc("/retweet/{id}", func(w http.ResponseWriter, req *http.Request) {
ctx := getContextWithSession(context.Background(), req)
@@ -193,7 +193,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
w.WriteHeader(http.StatusFound)
- }).Methods(http.MethodGet)
+ }).Methods(http.MethodPost)
r.HandleFunc("/unretweet/{id}", func(w http.ResponseWriter, req *http.Request) {
ctx := getContextWithSession(context.Background(), req)
@@ -206,7 +206,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
w.WriteHeader(http.StatusFound)
- }).Methods(http.MethodGet)
+ }).Methods(http.MethodPost)
r.HandleFunc("/post", func(w http.ResponseWriter, req *http.Request) {
ctx := getContextWithSession(context.Background(), req)