Skip to content

Commit 4477fb0

Browse files
committed
sse project visibility check
1 parent 1c21ada commit 4477fb0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

streaming.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,25 @@ func publishArchiveEvent(event ArchiveEvent) {
5353

5454
func stats_panel(c *gin.Context) {
5555
identifier := c.Param("identifier")
56-
// project := GetProject(identifier)
57-
// if !project.Status.Public {
58-
// c.JSON(403, gin.H{"error": "Project is not public"})
59-
// return
60-
// }
56+
project := GetProject(identifier)
57+
if !project.Status.Public {
58+
c.JSON(403, gin.H{"error": "Project is not public"})
59+
return
60+
}
6161
c.HTML(200, "stats.tmpl", gin.H{
6262
"identifier": identifier,
6363
})
6464
}
6565

6666
func sse_stream(c *gin.Context) {
6767
identifier := c.Param("identifier")
68+
69+
project := GetProject(identifier)
70+
if !project.Status.Public {
71+
c.JSON(403, gin.H{"error": "Project is not public"})
72+
return
73+
}
74+
6875
returnsChan := make(chan valkey.PubSubMessage)
6976

7077
go func() {

0 commit comments

Comments
 (0)