Add tiered configuration.

This commit is contained in:
Ben Johnson
2013-10-21 16:00:20 -06:00
parent 90c5614cd4
commit bc0e07bca2
45 changed files with 4004 additions and 394 deletions

View File

@@ -283,10 +283,10 @@ func (s *Server) Dispatch(c raft.Command, w http.ResponseWriter, req *http.Reque
}
// Sets a comma-delimited list of origins that are allowed.
func (s *Server) AllowOrigins(origins string) error {
func (s *Server) AllowOrigins(origins []string) error {
// Construct a lookup of all origins.
m := make(map[string]bool)
for _, v := range strings.Split(origins, ",") {
for _, v := range origins {
if v != "*" {
if _, err := url.Parse(v); err != nil {
return fmt.Errorf("Invalid CORS origin: %s", err)