File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -490,12 +490,6 @@ func RegisterRoutes(m *macaron.Macaron) {
490
490
return
491
491
}
492
492
493
- //Attachement without issue or release attached should not be returned
494
- if ! attach .IsLinked () {
495
- ctx .Error (404 )
496
- return
497
- }
498
- //Check issue access
499
493
if attach .IssueID != 0 {
500
494
iss , err := models .GetIssueByID (attach .IssueID )
501
495
if err != nil {
@@ -506,10 +500,7 @@ func RegisterRoutes(m *macaron.Macaron) {
506
500
ctx .Error (403 )
507
501
return
508
502
}
509
- }
510
-
511
- //Check release access
512
- if attach .ReleaseID != 0 {
503
+ } else if attach .ReleaseID != 0 {
513
504
rel , err := models .GetReleaseByID (attach .ReleaseID )
514
505
if err != nil {
515
506
ctx .ServerError ("GetAttachmentByUUID.GetReleaseByID" , err )
@@ -519,8 +510,10 @@ func RegisterRoutes(m *macaron.Macaron) {
519
510
ctx .Error (403 )
520
511
return
521
512
}
513
+ } else {
514
+ ctx .Error (404 )
522
515
}
523
-
516
+
524
517
//If we have matched a access release or issue
525
518
fr , err := os .Open (attach .LocalPath ())
526
519
if err != nil {
You can’t perform that action at this time.
0 commit comments