Refactor FormatVersion function to handle invalid characters (#6244)

* Refactor FormatVersion function to handle invalid characters

* Use SHA1 instead of MD5
This commit is contained in:
inksnw
2024-10-30 12:51:05 +08:00
committed by GitHub
parent 7992b75072
commit 9aa17af5db
4 changed files with 16 additions and 17 deletions

View File

@@ -61,8 +61,8 @@ func (h *appHandler) CreateOrUpdateAppVersion(req *restful.Request, resp *restfu
return
}
appVersion := &appv2.ApplicationVersion{}
vRequest.VersionName = application.FormatVersion(vRequest.VersionName)
appVersion.Name = fmt.Sprintf("%s-%s", createAppVersionRequest.AppName, vRequest.VersionName)
legalVersion := application.FormatVersion(vRequest.VersionName)
appVersion.Name = fmt.Sprintf("%s-%s", createAppVersionRequest.AppName, legalVersion)
if h.conflictedDone(req, resp, "version", appVersion) {
return
}