func ExemptedGlobs(paths ...string) {
	for _, v := range paths {
		ExemptedGlob(v)
	}
}
ExemptedGlobs exempts paths from CSRF checks using pattern matching.
package csrf
import (
	"fmt"
	pathPackage "path"
	"sync"
	"github.com/revel/revel"
)
type globPath struct {
	sync.RWMutex
	list []string
}
var (
	exemptionsFullPath = struct {
		sync.RWMutex
		list map[string]struct{}
	}{
		list: make(map[string]struct{}),
	}
	exemptionsGlobs globPath
)
func IsExempted(path string) bool {
	exemptionsFullPath.RLock()
	_, found := exemptionsFullPath.list[path]
	exemptionsFullPath.RUnlock()
	if found {
		revel.AppLog.Infof("REVEL-CSRF: Ignoring exempted route '%s'...\n", path)
		return true
	}
	for _, glob := range exemptionsGlobs.list {
		exemptionsGlobs.RLock()
		found, err := pathPackage.Match(glob, path)
		exemptionsGlobs.RUnlock()
		if err != nil {
			panic(fmt.Sprintf("REVEL-CSRF: malformed glob pattern: %#v", err))
		}
		if found {
			revel.AppLog.Infof("REVEL-CSRF: Ignoring exempted route '%s'...", path)
			return true
		}
	}
	return false
}
func ExemptedFullPath(path string) {
	revel.AppLog.Infof("REVEL-CSRF: Adding exemption '%s'...\n", path)
	exemptionsFullPath.Lock()
	exemptionsFullPath.list[path] = struct{}{}
	exemptionsFullPath.Unlock()
}
func ExemptedFullPaths(paths ...string) {
	for _, v := range paths {
		ExemptedFullPath(v)
	}
}
func ExemptedGlob(path string) {
	revel.AppLog.Infof("REVEL-CSRF: Adding exemption GLOB '%s'...\n", path)
	exemptionsGlobs.Lock()
	exemptionsGlobs.list = append(exemptionsGlobs.list, path)
	exemptionsGlobs.Unlock()
}