@@ -11,8 +11,8 @@ import (
1111 "strings"
1212 "unicode"
1313
14- "code.gitea.io/gitea/modules/globallock"
1514 packages_model "code.gitea.io/gitea/models/packages"
15+ "code.gitea.io/gitea/modules/globallock"
1616 "code.gitea.io/gitea/modules/log"
1717 packages_module "code.gitea.io/gitea/modules/packages"
1818 "code.gitea.io/gitea/routers/api/packages/helper"
@@ -21,8 +21,8 @@ import (
2121)
2222
2323var (
24- packageNameRegex = regexp .MustCompile (`\A[-_+.\w]+\z` )
25- filenameRegex = regexp .MustCompile (`\A[-_+=:;.()\[\]{}~!@#$%^& \w]+\z` )
24+ packageNameRegex = regexp .MustCompile (`\A[-_+.\w]+\z` )
25+ filenameRegex = regexp .MustCompile (`\A[-_+=:;.()\[\]{}~!@#$%^& \w]+\z` )
2626)
2727
2828func apiError (ctx * context.Context , status int , obj any ) {
@@ -221,7 +221,6 @@ func LockPackage(ctx *context.Context) {
221221 return
222222 }
223223
224- //log.Error("pv: %+v", pv)
225224 ok , _ , err := globallock .TryLock (ctx , fmt .Sprintf ("%s/%s" , packageName , pv .LowerVersion ))
226225 if err != nil {
227226 apiError (ctx , http .StatusInternalServerError , err )
@@ -248,7 +247,6 @@ func UnlockPackage(ctx *context.Context) {
248247 return
249248 }
250249
251- //log.Error("pv: %+v", pv)
252250 _ = globallock .Unlock (ctx , fmt .Sprintf ("%s/%s" , packageName , pv .LowerVersion ))
253251
254252 ctx .Status (http .StatusOK )
0 commit comments