mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-05 11:28:45 +00:00
Use post method for like and retweet
This commit is contained in:
parent
e9bd72306e
commit
50e58c4e01
3 changed files with 20 additions and 16 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue