Skip to content

Commit

Permalink
submit: reorganize check for Google Play testers
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Nov 14, 2023
1 parent a86ec10 commit 6acebbf
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,22 +367,20 @@ func (s *submitServer) parseRequest(w http.ResponseWriter, req *http.Request, re
}
}

if p.AppName == "booper" {
if gplaySpamEmailRegex.MatchString(p.Data["user_id"]) {
log.Println("Dropping report from", p.Data["user_id"])
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(200)
_, _ = w.Write([]byte("{}"))
return nil
}
}

userID, hasUserID := p.Data["user_id"]
delete(p.Data, "user_id")
delete(p.Data, "verified_device_id")
if !hasUserID {
return p
} else if p.AppName == "booper" {
if gplaySpamEmailRegex.MatchString(userID) {
log.Println("Dropping report from", userID)
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(200)
_, _ = w.Write([]byte("{}"))
return nil
}

whoami, err := s.verifyIMAToken(req.Context(), req.Header.Get("Authorization"), userID)
if err != nil {
log.Printf("Error verifying user ID (%s): %v", userID, err)
Expand Down

0 comments on commit 6acebbf

Please sign in to comment.