|
|
@ -227,8 +227,14 @@ func (service *FileIDService) CreateDocPreviewSession(ctx context.Context, c *gi
|
|
|
|
return serializer.Err(serializer.CodeNotSet, err.Error(), err)
|
|
|
|
return serializer.Err(serializer.CodeNotSet, err.Error(), err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// For newer version of Cloudreve - Local Policy
|
|
|
|
|
|
|
|
// When do not use a cdn, the downloadURL withouts hosts, like "/api/v3/file/download/xxx"
|
|
|
|
if strings.HasPrefix(downloadURL, "/") {
|
|
|
|
if strings.HasPrefix(downloadURL, "/") {
|
|
|
|
downloadURL = path.Join(model.GetSiteURL().String(), downloadURL)
|
|
|
|
downloadURI, err := url.Parse(downloadURL)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return serializer.Err(serializer.CodeNotSet, err.Error(), err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
downloadURL = model.GetSiteURL().ResolveReference(downloadURI).String()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var resp serializer.DocPreviewSession
|
|
|
|
var resp serializer.DocPreviewSession
|
|
|
|