0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
caddy/middleware/path.go

14 lines
350 B
Go
Raw Normal View History

2015-01-30 00:08:40 -05:00
package middleware
import "strings"
// Path represents a URI path, maybe with pattern characters.
type Path string
// Path matching will probably not always be a direct
// comparison; this method assures that paths can be
2015-04-18 10:54:35 -05:00
// easily and consistently matched.
2015-01-30 00:08:40 -05:00
func (p Path) Matches(other string) bool {
return strings.HasPrefix(string(p), other)
}