fix: return absolute asset urls (#3676)

This commit is contained in:
Livio Amstutz
2022-05-20 10:30:12 +02:00
committed by GitHub
parent db0e7495e7
commit 62c4a4d08d
16 changed files with 45 additions and 34 deletions

View File

@@ -50,6 +50,12 @@ func (h *Handler) Storage() static.Storage {
return h.storage
}
func AssetAPI(externalSecure bool) func(context.Context) string {
return func(ctx context.Context) string {
return http_util.BuildOrigin(authz.GetInstance(ctx).RequestedHost(), externalSecure) + HandlerPrefix
}
}
type Uploader interface {
UploadAsset(ctx context.Context, info string, asset *command.AssetUpload, commands *command.Commands) error
ObjectName(data authz.CtxData) (string, error)