1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-02 15:06:23 -07:00

Set Content-Type header to application/json when a post is submitted

This commit is contained in:
Eggbertx 2023-06-22 10:46:04 -07:00
parent 1facbdcd48
commit 4264b8eeec

View file

@ -376,6 +376,7 @@ func MakePost(writer http.ResponseWriter, request *http.Request) {
if !post.IsTopPost {
topPost, _ = post.TopPostID()
}
writer.Header().Set("Content-Type", "application/json")
json.NewEncoder(writer).Encode(map[string]interface{}{
"time": post.CreatedOn,
"id": post.ID,