feat(wopi): fetch discover endpoint

This commit is contained in:
HFO4
2023-01-09 19:34:39 +08:00
parent 42a31f2fd1
commit c39daeb0d0
5 changed files with 272 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
package wopi
import (
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/stretchr/testify/assert"
"net/url"
"testing"
)
func TestDiscovery(t *testing.T) {
a := assert.New(t)
endpoint, _ := url.Parse("http://localhost:8001/hosting/discovery")
client := &client{
cache: cache.Store,
http: request.NewClient(),
config: config{
discoveryEndpoint: endpoint,
},
}
a.NoError(client.refreshDiscovery())
client.NewSession(nil, &model.File{Name: "123.pptx"}, ActionPreview)
}