Use the correct scheme for URIs
This commit is contained in:
parent
124d1b7078
commit
353a3ea442
2 changed files with 3 additions and 1 deletions
|
|
@ -56,6 +56,7 @@ func (r *router) IDToURI(route string, id int) (string, error) {
|
|||
if err != nil {
|
||||
return "", fmt.Errorf("build uri: %w", err)
|
||||
}
|
||||
uri.Scheme = "https"
|
||||
return uri.String(), nil
|
||||
}
|
||||
|
||||
|
|
@ -71,6 +72,7 @@ func (r *router) UUIDToURI(route string, u *uuid.UUID) (*string, error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("build uri: %w", err)
|
||||
}
|
||||
uri.Scheme = "https"
|
||||
result := uri.String()
|
||||
return &result, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ const saveChanges = async () => {
|
|||
console.log("empty user");
|
||||
return;
|
||||
}
|
||||
const url = "/api" + u.uri;
|
||||
const url = u.uri;
|
||||
const response = await fetch(url, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue