// AllowAll create a new Cors handler with permissive configuration allowing all
// origins with all standard methods with any header and credentials.
164753
func AllowAll() *Cors {
	return New(Options{
		AllowedOrigins: []string{"*"},
		AllowedMethods: []string{
			http.MethodHead,
			http.MethodGet,
			http.MethodPost,
			http.MethodPut,
			http.MethodPatch,
			http.MethodDelete,
		},
		AllowedHeaders:   []string{"*"},
		AllowCredentials: false,
	})
}
156974
func MethodNotAllowed(routes martini.Routes, w http.ResponseWriter, r *http.Request) {
	if methods := routes.MethodsFor(r.URL.Path); len(methods) != 0 {
		w.Header().Set("Allow", strings.Join(methods, ","))
		w.WriteHeader(http.StatusMethodNotAllowed)
	}
}
432700
func (s *CorsRule) SetAllowedHeaders(v []*string) *CorsRule {
	s.AllowedHeaders = v
	return s
}
560722
func (a *AuthorizationsService) All() (auths []Authorization, result *Result) {
	result = a.client.get(a.URL, &auths)
	return
}
1146612
func AllowedMethods(methods []string) CORSOption {
	return func(ch *cors) error {
		ch.allowedMethods = []string{}
		for _, v := range methods {
			normalizedMethod := strings.ToUpper(strings.TrimSpace(v))
			if normalizedMethod == "" {
				continue
			}

			if !ch.isMatch(normalizedMethod, ch.allowedMethods) {
				ch.allowedMethods = append(ch.allowedMethods, normalizedMethod)
			}
		}

		return nil
	}
}
727981
func (l *Limiter) Allow(name string, maxn int64, period time.Duration) (count int64, delay time.Duration, allow bool) {
	return l.AllowN(name, maxn, period, 1)
}
869939
func (s *IndicesGetSettingsService) AllowNoIndices(allowNoIndices bool) *IndicesGetSettingsService {
	s.allowNoIndices = &allowNoIndices
	return s
}
254124
func Cors(allowedOrigins ...string) http.HandlerFunc {
	if len(allowedOrigins) == 0 {
		allowedOrigins = append(allowedOrigins, "*")
	}
	return func(rw http.ResponseWriter, req *http.Request) {
		allowed := false
		// Set appropriate response headers required for CORS
		reqOrigin := req.Header.Get(headerGetOrigin)
		for _, o := range allowedOrigins {
			// Set appropriate response headers required for CORS
			if o == "*" || o == reqOrigin {
				rw.Header().Set(headerOrigin, reqOrigin)
				allowed = true
				break
			}
		}

		if !allowed {
			webgo.SendHeader(rw, http.StatusForbidden)
			return
		}

		rw.Header().Set(headerMethods, allowMethods)
		rw.Header().Set(headerCreds, "true")

		// Adding allowed headers
		rw.Header().Set(headerAllowHeaders, allowHeaders+req.Header.Get(headerReqHeaders))
	}
}
485499
func (self *HttpClient) AllowInsecure(insecure bool) {
	if insecure {
		tr := &http.Transport{
			TLSClientConfig: &tls.Config{
				InsecureSkipVerify: true,
			}}

		self.client.Transport = tr
	} else {
		self.client.Transport = nil
	}
}
141465
func (c Config) AllowModelAccess() bool {
	value, _ := c[AllowModelAccessKey].(bool)
	return value
}
82829
func (r *Router) All(path string, handler HandlerFunc) {
	r.Add(GET, path, handler)
	r.Add(POST, path, handler)
	r.Add(PUT, path, handler)
	r.Add(DELETE, path, handler)
	r.Add(PATCH, path, handler)
	r.Add(OPTIONS, path, handler)
	r.Add(HEAD, path, handler)
}
744602
func (c *Client) All(ctx context.Context) ([]chronograf.User, error) {
	users, err := c.showUsers(ctx)
	if err != nil {
		return nil, err
	}

	// For all users we need to look up permissions to add to the user.
	for i, user := range users {
		perms, err := c.userPermissions(ctx, user.Name)
		if err != nil {
			return nil, err
		}

		user.Permissions = append(user.Permissions, perms...)
		users[i] = user
	}
	return users, nil
}
579209
func AllowOther() MountOption {
	return func(conf *mountConfig) error {
		if _, ok := conf.options["allow_root"]; ok {
			return ErrCannotCombineAllowOtherAndAllowRoot
		}
		conf.options["allow_other"] = ""
		return nil
	}
}
564736
func methodNotAllowedHandler(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	allow := w.Header().Get("Allow")
	pe := &platform.Error{
		Code: platform.EMethodNotAllowed,
		Msg:  fmt.Sprintf("allow: %s", allow),
	}

	EncodeError(ctx, pe, w)
}
50377
func (s *IndicesSegmentsService) AllowNoIndices(allowNoIndices bool) *IndicesSegmentsService {
	s.allowNoIndices = &allowNoIndices
	return s
}
1214996
func (s *CORSRule) SetAllowedMethods(v []*string) *CORSRule {
	s.AllowedMethods = v
	return s
}
116039
func (s *CloseIndexService) AllowNoIndices(allowNoIndices bool) *CloseIndexService {
	s.allowNoIndices = &allowNoIndices
	return s
}