Skip to content

Commit

Permalink
set content type to application json for server apis
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyrAhmady committed Oct 5, 2023
1 parent a4013d1 commit b6ca9eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/transports/api/servers/h_fulllist.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ func (s *service) fulllist(w http.ResponseWriter, r *http.Request) {
return
}

w.Header().Add("Content-Type", "application/json")
web.Write(w, list)
}
2 changes: 2 additions & 0 deletions app/transports/api/servers/h_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ func (s *service) get(w http.ResponseWriter, r *http.Request) {
}
return
}

w.Header().Add("Content-Type", "application/json")
web.Write(w, result)
}
1 change: 1 addition & 0 deletions app/transports/api/servers/h_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ func (s *service) list(w http.ResponseWriter, r *http.Request) {
essential = append(essential, item.Core)
}

w.Header().Add("Content-Type", "application/json")
web.Write(w, essential)
}

0 comments on commit b6ca9eb

Please sign in to comment.