Set user agent in getting HTTP status code

Close #8
This commit is contained in:
2025-02-25 22:14:27 +01:00
parent 3cb49d005e
commit 5afc375042
4 changed files with 33 additions and 6 deletions

View File

@@ -3,7 +3,6 @@ package configloader
import (
"errors"
"net/url"
"net/http"
"strings"
)
@@ -29,11 +28,11 @@ func ValidateInstanceLink(instanceUrl string) (string, error) {
Host: parsed.Host,
Path: "/musdb",
}
resp, err := http.Get(musdbUrl.String())
statusCode, err := HttpGetStatusCode(musdbUrl.String())
if err != nil {
return "", err
}
if resp.StatusCode > 399 {
if statusCode > 399 {
return "", errors.New("The museum-digital subdomain does not contain a musdb path")
}