TruthHun/DocHub

dochub2.4 本地部署minio 上传转化预览都正确了,但是下载的时候签名错误,无法下载

qq547057827 opened this issue · 1 comments

dochub2.4 本地部署minio 上传转化预览都正确了,但是下载的时候签名错误,无法下载

SignatureDoesNotMatch

The request signature we calculated does not match the signature you provided. Check your key and signing method.

而且 如果 私有Bucket域名 填写 http://xx.xx.xx.xx.:9000/dochub-private

则下载文档时的链接为 http://xx.xx.xx.xx:9000/dochub-private/dochub-private/c8253f2949ca9f0dac7db4381e3f1606.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=nLkc1Pxqd005LfIX%2F20200205%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200205T054935Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=251618920aee219dc6d43b1e837ebb1e9c63ecd28529a6cdd3f0434f00eedc27

路径中出现两次 dochub-private
怀疑出现代码中多加了一个dochub-private 导致签名不正确

CloudStore\minio.go 有个过期时间小于0,临时办法默认加个 "/dochub-public"
func (m *MinIO) GetSignURL(object string, expire int64) (link string, err error) { if expire <= 0 { link = m.Domain + "/dochub-public" + objectAbs(object) return }
让构建的url
能够拼出 http://192.168.99.100:9000/dochub-public/40ff84824b4c4b6aa2ec70194c06238c.jpg
的结构就能正常显示了