-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20de37d
commit 017ba6f
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
from os import getenv | ||
|
||
# Obtém o caminho do diretório dos arquivos estáticos via variável de ambiente | ||
origin_regex = r"^https:\/\/(?:\w+\.)?lapig\.iesa\.ufg\.br$|^https:\/\/lapig-ufg\.github\.io$" | ||
|
||
# Função para obter as origens separadas por vírgula da variável de ambiente | ||
def get_origins_from_env(): | ||
origins = getenv('ALLOW_ORIGINS', '') | ||
if not origins: | ||
return [] # Retorna lista vazia se a variável de ambiente não estiver definida ou estiver vazia | ||
return [origin.strip() for origin in origins.split(',') if origin] | ||
|
||
|
||
# Obtém as origens permitidas da variável de ambiente | ||
allow_origins = get_origins_from_env() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters