Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Commit

Permalink
add allow all origin
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinGao committed Jan 23, 2021
1 parent ffe46af commit 5a8f978
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ http:

app:
dsn: "host=localhost user=root password=root dbname=penguinprobe port=5432 sslmode=disable TimeZone=Asia/Shanghai"
allowAllOrigin: true
debug: true
pprof: true
2 changes: 1 addition & 1 deletion internal/pkg/commons/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func IsValidDomain(u *url.URL) bool {
}

func GenOriginChecker() func(r *http.Request) bool {
if viper.GetBool("app.debug") {
if viper.GetBool("app.allowAllOrigin") {
return func(r *http.Request) bool {
return true
}
Expand Down

0 comments on commit 5a8f978

Please sign in to comment.