mirror of
https://github.com/BillyOutlast/posthog.git
synced 2026-02-04 03:01:23 +01:00
chore: do not return 404 if no stats are available on /stats endpoint (#25462)
This commit is contained in:
@@ -127,13 +127,11 @@ func main() {
|
||||
} else {
|
||||
teamId = ""
|
||||
|
||||
log.Println("~~~~ Looking for auth header")
|
||||
authHeader := c.Request().Header.Get("Authorization")
|
||||
if authHeader == "" {
|
||||
return errors.New("authorization header is required")
|
||||
}
|
||||
|
||||
log.Println("~~~~ decoding auth header")
|
||||
claims, err := decodeAuthToken(authHeader)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -141,7 +139,6 @@ func main() {
|
||||
teamId = strconv.Itoa(int(claims["team_id"].(float64)))
|
||||
token = fmt.Sprint(claims["api_token"])
|
||||
|
||||
log.Printf("~~~~ team found %s", teamId)
|
||||
if teamId == "" {
|
||||
return errors.New("teamId is required unless geo=true")
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func statsHandler(stats *Stats) func(c echo.Context) error {
|
||||
resp := resp{
|
||||
Error: "no stats",
|
||||
}
|
||||
return c.JSON(http.StatusNotFound, resp)
|
||||
return c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
siteStats := resp{
|
||||
|
||||
Reference in New Issue
Block a user