mirror of
https://github.com/idanoo/go-mastodon-matrix-webhooks.git
synced 2024-11-22 08:25:17 +00:00
Updates
This commit is contained in:
parent
beb8919b67
commit
a94a89de96
10
main.go
10
main.go
@ -66,16 +66,10 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Printf("Headers: %+v\n", r.Header)
|
||||
|
||||
if len(bodyBytes) > 0 {
|
||||
b, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
var i IdentifyingRequest
|
||||
err = json.Unmarshal(b, &i)
|
||||
err := json.NewDecoder(r.Body).Decode(&i)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user