mirror of https://github.com/cloudreve/Cloudreve
fix: catch s3 presign err (#1277)
parent
eef6c40441
commit
5bd711afc6
|
@ -4,9 +4,6 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/chunk"
|
|
||||||
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/chunk/backoff"
|
|
||||||
"github.com/cloudreve/Cloudreve/v3/pkg/util"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
@ -15,6 +12,10 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/chunk"
|
||||||
|
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/chunk/backoff"
|
||||||
|
"github.com/cloudreve/Cloudreve/v3/pkg/util"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||||
"github.com/aws/aws-sdk-go/aws/session"
|
"github.com/aws/aws-sdk-go/aws/session"
|
||||||
|
@ -299,7 +300,10 @@ func (handler *Driver) Source(
|
||||||
ttl = 3600
|
ttl = 3600
|
||||||
}
|
}
|
||||||
|
|
||||||
signedURL, _ := req.Presign(time.Duration(ttl) * time.Second)
|
signedURL, err := req.Presign(time.Duration(ttl) * time.Second)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
// 将最终生成的签名URL域名换成用户自定义的加速域名(如果有)
|
// 将最终生成的签名URL域名换成用户自定义的加速域名(如果有)
|
||||||
finalURL, err := url.Parse(signedURL)
|
finalURL, err := url.Parse(signedURL)
|
||||||
|
|
Loading…
Reference in New Issue