on admin page, show warning when user hasn't enabled "check updates"

and send Accept-header when fetching changelog, so we can show an html version
instead of json when requested by regular browsers.
This commit is contained in:
Mechiel Lukkien
2023-02-27 15:03:37 +01:00
parent d3590caa2e
commit 67c97c6499
4 changed files with 22 additions and 1 deletions

View File

@ -151,6 +151,7 @@ func FetchChangelog(ctx context.Context, baseURL string, base Version, pubKey []
if err != nil {
return nil, fmt.Errorf("making request: %v", err)
}
req.Header.Add("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if resp == nil {
resp = &http.Response{StatusCode: 0}