refactor(media): 资源分发 - 统一资源访问策略与云存储重定向

This commit is contained in:
ddCat committed 2026-09-22 21:41:00 +08:00
1 parent af6633047c
commit 487c34bfeb
50 files changed
+2112 -1266

No files matched your search

@@ -80,9 +80,9 @@ func TestTencentCOSConnectionTestUsesStorageEndpointInsteadOfCDN(t *testing.T) {
func TestOSSConnectionReadAcceptsFullObjectWhenRangeIsIgnored(t *testing.T) {
payload := []byte("yingce-storage-test")
stream := &ossObjectStream{
body: io.NopCloser(strings.NewReader(string(payload))),
statusCode: http.StatusOK,
contentLength: int64(len(payload)),
Body: io.NopCloser(strings.NewReader(string(payload))),
StatusCode: http.StatusOK,
ContentLength: int64(len(payload)),
}
if err := verifyOSSConnectionRead(stream, payload); err != nil {
t.Fatal(err)
@@ -92,9 +92,9 @@ func TestOSSConnectionReadAcceptsFullObjectWhenRangeIsIgnored(t *testing.T) {
func TestOSSConnectionReadRejectsUnexpectedContent(t *testing.T) {
payload := []byte("yingce-storage-test")
stream := &ossObjectStream{
body: io.NopCloser(strings.NewReader("error page")),
statusCode: http.StatusOK,
contentLength: 10,
Body: io.NopCloser(strings.NewReader("error page")),
StatusCode: http.StatusOK,
ContentLength: 10,
}
err := verifyOSSConnectionRead(stream, payload)
if err == nil {