mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-07 16:32:51 +03:00
Pull request 1838: 5716-content-type
Updates #5716. Squashed commit of the following: commit 584e6771c82b92857e3c13232e942cad5c183682 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Apr 19 14:54:43 2023 +0300 all: fix content types
This commit is contained in:
parent
aeec9a86e2
commit
d6043e2352
5 changed files with 27 additions and 19 deletions
internal/home
|
@ -26,15 +26,14 @@ type temporaryError interface {
|
|||
Temporary() (ok bool)
|
||||
}
|
||||
|
||||
// Get the latest available version from the Internet
|
||||
func handleGetVersionJSON(w http.ResponseWriter, r *http.Request) {
|
||||
// handleVersionJSON is the handler for the POST /control/version.json HTTP API.
|
||||
//
|
||||
// TODO(a.garipov): Find out if this API used with a GET method by anyone.
|
||||
func handleVersionJSON(w http.ResponseWriter, r *http.Request) {
|
||||
resp := &versionResponse{}
|
||||
if Context.disableUpdate {
|
||||
resp.Disabled = true
|
||||
err := json.NewEncoder(w).Encode(resp)
|
||||
if err != nil {
|
||||
aghhttp.Error(r, w, http.StatusInternalServerError, "writing body: %s", err)
|
||||
}
|
||||
_ = aghhttp.WriteJSONResponse(w, r, resp)
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue