summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/release_tags.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/routers/api/v1/repo/release_tags.go b/routers/api/v1/repo/release_tags.go
index ef07ce5e1a..70011a6a8e 100644
--- a/routers/api/v1/repo/release_tags.go
+++ b/routers/api/v1/repo/release_tags.go
@@ -48,14 +48,19 @@ func GetReleaseTag(ctx *context.APIContext) {
release, err := models.GetRelease(ctx.Repo.Repository.ID, tag)
if err != nil {
if models.IsErrReleaseNotExist(err) {
- ctx.Error(http.StatusNotFound, "GetRelease", err)
+ ctx.NotFound()
return
}
ctx.Error(http.StatusInternalServerError, "GetRelease", err)
return
}
- if err := release.LoadAttributes(); err != nil {
+ if release.IsTag {
+ ctx.NotFound()
+ return
+ }
+
+ if err = release.LoadAttributes(); err != nil {
ctx.Error(http.StatusInternalServerError, "LoadAttributes", err)
return
}