Ensure public id for accept is an url
All checks were successful
/ docker (push) Successful in 4m22s
All checks were successful
/ docker (push) Successful in 4m22s
This commit is contained in:
parent
2c0a4c88d5
commit
b75db5676b
1 changed files with 9 additions and 1 deletions
|
@ -5,12 +5,14 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
webutils "git.mstar.dev/mstar/goutils/http"
|
||||
"github.com/rs/zerolog/hlog"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"git.mstar.dev/mstar/linstrom/activitypub"
|
||||
"git.mstar.dev/mstar/linstrom/config"
|
||||
"git.mstar.dev/mstar/linstrom/storage-new"
|
||||
"git.mstar.dev/mstar/linstrom/storage-new/dbgen"
|
||||
"git.mstar.dev/mstar/linstrom/storage-new/models"
|
||||
|
@ -66,8 +68,14 @@ func AcceptFromStorage(ctx context.Context, id string) (*ActivityAcceptOut, erro
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var outId string
|
||||
if strings.HasPrefix(id, "http") {
|
||||
outId = id
|
||||
} else {
|
||||
outId = fmt.Sprintf("%s/api/activitypub/activity/accept/%s", config.GlobalConfig.General.GetFullPublicUrl(), id)
|
||||
}
|
||||
return &ActivityAcceptOut{
|
||||
Id: id,
|
||||
Id: outId,
|
||||
Actor: follow.Object.(string),
|
||||
Type: "Accept",
|
||||
Object: follow,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue