Skip to content

Commit

Permalink
potential update to CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebRose committed Apr 27, 2024
1 parent 2572c58 commit 12b40f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func handleRequests() {
loadEnvs()
origins := os.Getenv("ORIGIN_ALLOWED")
originsOk := handlers.AllowedOrigins([]string{origins})
headersOk := handlers.AllowedHeaders([]string{"Content-Type", "Authorization", "Accept", "X-Requested-With", "Access-Control-Request-Method", "Access-Control-Request-Headers"})
headersOk := handlers.AllowedHeaders([]string{"Content-Type", "Authorization", "Accept", "X-Requested-With", "Access-Control-Request-Method", "Access-Control-Request-Headers", "Access-Control-Allow-Origin"})
methodsOk := handlers.AllowedMethods([]string{"GET", "HEAD", "POST", "PUT", "OPTIONS"})
handler := handlers.CORS(originsOk, methodsOk, headersOk)(myRouter)
myRouter.Use(middleware.GzipMiddleware)
Expand Down
4 changes: 2 additions & 2 deletions managers/AdminManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ func SyncTimeslot(timeslot string) {
db.Save(&awayTeamStandings)
}

if (game.HomeTeamWin && ((game.HomeTeamRank == 0 && game.AwayTeamRank > 0) || game.HomeTeamRank > 0 && game.HomeTeamRank < game.AwayTeamRank)) ||
(game.AwayTeamWin && ((game.AwayTeamRank == 0 && game.HomeTeamRank > 0) || game.AwayTeamRank > 0 && game.AwayTeamRank < game.HomeTeamRank)) {
if (game.HomeTeamWin && ((game.HomeTeamRank == 0 && game.AwayTeamRank > 0) || (game.HomeTeamRank > 0 && game.HomeTeamRank < game.AwayTeamRank))) ||
(game.AwayTeamWin && ((game.AwayTeamRank == 0 && game.HomeTeamRank > 0) || (game.AwayTeamRank > 0 && game.AwayTeamRank < game.HomeTeamRank))) {
// NEWS LOG
messageStart := "UPSET: "
messageType := "Upset Alert"
Expand Down

0 comments on commit 12b40f0

Please sign in to comment.