minor fix

This commit is contained in:
Anish Mukherjee
2022-12-13 11:08:53 +05:30
parent 9c019ca1b1
commit 72687b9a0f
3 changed files with 50 additions and 49 deletions

View File

@@ -6,6 +6,7 @@ import (
"net/http"
"os"
"os/signal"
"strings"
"sync"
"syscall"
"time"
@@ -38,7 +39,7 @@ func HandleRESTRequests(wg *sync.WaitGroup) {
// Currently allowed dev origin is all. Should change in prod
// should consider analyzing the allowed methods further
headersOk := handlers.AllowedHeaders([]string{"Access-Control-Allow-Origin", "X-Requested-With", "Content-Type", "authorization"})
originsOk := handlers.AllowedOrigins(servercfg.GetAllowedOrigin())
originsOk := handlers.AllowedOrigins(strings.Split(servercfg.GetAllowedOrigin(), ","))
methodsOk := handlers.AllowedMethods([]string{"GET", "PUT", "POST", "DELETE"})
for _, handler := range HttpHandlers {