Add the four settings the README documented but pixa lacked (closes #61)
check / check (push) Successful in 2m58s
check / check (push) Successful in 2m58s
access_control_allow_origin, upstream_fetch_timeout, upstream_max_response_size and downstream_timeout were in the README but unknown to pixa, so a config that followed it aborted startup. Each is now a setting with its PIXA_ variable, defaulting to the value that was fixed in the code: *, 30s, 50 MiB and 60s. Durations are positive Go duration strings; the size is a positive whole number of bytes; the origin is * or one scheme and host. An invalid value aborts startup naming the key and value. downstream_timeout replaces HTTPWriteTimeout for the server's write timeout and the per-request timeout. Model: opus-5-5
This commit is contained in:
@@ -145,7 +145,7 @@ func (s *Middleware) Logging() func(http.Handler) http.Handler {
|
||||
// CORS returns a CORS middleware.
|
||||
func (s *Middleware) CORS() func(http.Handler) http.Handler {
|
||||
return cors.Handler(cors.Options{
|
||||
AllowedOrigins: []string{"*"},
|
||||
AllowedOrigins: []string{s.config.AccessControlAllowOrigin},
|
||||
AllowedMethods: []string{"GET", "HEAD", "OPTIONS"},
|
||||
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type"},
|
||||
ExposedHeaders: []string{"Link"},
|
||||
|
||||
Reference in New Issue
Block a user