mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-25 19:22:46 +08:00
s3 presigned test
This commit is contained in:
parent
2f1d9f6265
commit
e62f5d8d7c
@ -117,7 +117,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
|
|||||||
objectGroup.POST("/auth_sign", t.AuthSign)
|
objectGroup.POST("/auth_sign", t.AuthSign)
|
||||||
objectGroup.POST("/complete_multipart_upload", t.CompleteMultipartUpload)
|
objectGroup.POST("/complete_multipart_upload", t.CompleteMultipartUpload)
|
||||||
objectGroup.POST("/access_url", t.AccessURL)
|
objectGroup.POST("/access_url", t.AccessURL)
|
||||||
objectGroup.GET("/object/*name", t.ObjectRedirect)
|
objectGroup.GET("/*name", t.ObjectRedirect)
|
||||||
}
|
}
|
||||||
//Message
|
//Message
|
||||||
msgGroup := r.Group("/msg", ParseToken)
|
msgGroup := r.Group("/msg", ParseToken)
|
||||||
|
@ -55,6 +55,13 @@ func (o *ThirdApi) AccessURL(c *gin.Context) {
|
|||||||
|
|
||||||
func (o *ThirdApi) ObjectRedirect(c *gin.Context) {
|
func (o *ThirdApi) ObjectRedirect(c *gin.Context) {
|
||||||
name := c.Param("name")
|
name := c.Param("name")
|
||||||
|
if name == "" {
|
||||||
|
c.String(http.StatusBadRequest, "name is empty")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if name[0] == '/' {
|
||||||
|
name = name[1:]
|
||||||
|
}
|
||||||
operationID := c.Query("operationID")
|
operationID := c.Query("operationID")
|
||||||
if operationID == "" {
|
if operationID == "" {
|
||||||
operationID = strconv.Itoa(rand.Int())
|
operationID = strconv.Itoa(rand.Int())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user