@@ -195,6 +195,7 @@ func SharingArchiveList(c *gin.Context, req *ArchiveListReq) {
195
195
func SharingDown (c * gin.Context ) {
196
196
sid := c .Request .Context ().Value (conf .SharingIDKey ).(string )
197
197
path := c .Request .Context ().Value (conf .PathKey ).(string )
198
+ path = utils .FixAndCleanPath (path )
198
199
pwd := c .Query ("pwd" )
199
200
s , err := op .GetSharingById (sid )
200
201
if err == nil {
@@ -219,6 +220,13 @@ func SharingDown(c *gin.Context) {
219
220
return
220
221
}
221
222
if setting .GetBool (conf .ShareForceProxy ) || common .ShouldProxy (storage , stdpath .Base (actualPath )) {
223
+ if _ , ok := c .GetQuery ("d" ); ! ok {
224
+ if url := common .GenerateDownProxyURL (storage .GetStorage (), unwrapPath ); url != "" {
225
+ c .Redirect (302 , url )
226
+ _ = countAccess (c .ClientIP (), s )
227
+ return
228
+ }
229
+ }
222
230
link , obj , err := op .Link (c .Request .Context (), storage , actualPath , model.LinkArgs {
223
231
Header : c .Request .Header ,
224
232
Type : c .Query ("type" ),
@@ -252,6 +260,7 @@ func SharingArchiveExtract(c *gin.Context) {
252
260
}
253
261
sid := c .Request .Context ().Value (conf .SharingIDKey ).(string )
254
262
path := c .Request .Context ().Value (conf .PathKey ).(string )
263
+ path = utils .FixAndCleanPath (path )
255
264
pwd := c .Query ("pwd" )
256
265
innerPath := utils .FixAndCleanPath (c .Query ("inner" ))
257
266
archivePass := c .Query ("pass" )
0 commit comments