fix: 修复文件预览重定向与扩展名解析

This commit is contained in:
richjohnrambo
2026-09-09 16:32:49 +08:00
parent cae5039afe
commit 23afc1b7f1
7 changed files with 117 additions and 12 deletions
+2 -4
View File
@@ -248,16 +248,14 @@ func (ah *awshandler) Headers(tenantID types.TenantID, method string, url *url.U
}
if redirURL != "" {
// Return presigned URL with 308 Permanent redirect. Let the client cache the response.
// The original URL will stop working after a short period of time to prevent use of Tinode
// as a free file server.
// Return a temporary redirect to a short-lived presigned URL.
return http.Header{
"Location": {redirURL},
"ETag": {`"` + fdef.ETag + `"`},
"Content-Type": {"application/json; charset=utf-8"},
"Cache-Control": {ah.conf.CacheControl},
},
http.StatusPermanentRedirect, nil
http.StatusFound, nil
}
return nil, 0, nil
}