Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tsachiherman committed Oct 17, 2023
1 parent 88e4fed commit e9ea639
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 4 additions & 3 deletions services/horizon/internal/httpx/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ func (r *Router) addMiddleware(config *RouterConfig,
r.Use(chimiddleware.Compress(flate.DefaultCompression, "application/hal+json"))

c := cors.New(cors.Options{
AllowedOrigins: []string{"*"},
AllowedHeaders: []string{"*"},
ExposedHeaders: []string{"Date", "Latest-Ledger"},
AllowedOrigins: []string{},
AllowOriginRequestFunc: func(*http.Request, string) bool { return true },
AllowedHeaders: []string{"*"},
ExposedHeaders: []string{"Date", "Latest-Ledger"},
})
r.Use(c.Handler)

Expand Down
8 changes: 6 additions & 2 deletions support/db/dbtest/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,13 @@ func Postgres(t testing.TB) *DB {
if len(pgUser) == 0 {
pgUser = "postgres"
}
pgPwd := os.Getenv("PGPASSWORD")
if len(pgPwd) == 0 {
pgPwd = "postgres"
}

postgresDSN := fmt.Sprintf("postgres://%s@localhost/?sslmode=disable", pgUser)
result.DSN = fmt.Sprintf("postgres://%s@localhost/%s?sslmode=disable&timezone=UTC", pgUser, result.dbName)
postgresDSN := fmt.Sprintf("postgres://%s:%s@localhost/?sslmode=disable", pgUser, pgPwd)
result.DSN = fmt.Sprintf("postgres://%s:%s@localhost/%s?sslmode=disable&timezone=UTC", pgUser, pgPwd, result.dbName)
result.RO_DSN = fmt.Sprintf("postgres://%s:%s@localhost/%s?sslmode=disable&timezone=UTC", "user_ro", "user_ro", result.dbName)

execStatement(t, fmt.Sprintf("CREATE DATABASE %s;", result.dbName), postgresDSN)
Expand Down
2 changes: 1 addition & 1 deletion support/logmetrics/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestLogPackageMetrics(t *testing.T) {
levelString = "warn"
}
expectedDesc := fmt.Sprintf(
"Desc{fqName: \"horizon_log_%s_total\", help: \"\", constLabels: {}, variableLabels: []}",
"Desc{fqName: \"horizon_log_%s_total\", help: \"\", constLabels: {}, variableLabels: {}}",
levelString,
)
assert.Equal(t, expectedDesc, meter.Desc().String())
Expand Down

0 comments on commit e9ea639

Please sign in to comment.