mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-24 03:19:59 +08:00
Moved Path type around
This commit is contained in:
13
middleware/path.go
Normal file
13
middleware/path.go
Normal file
@ -0,0 +1,13 @@
|
||||
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
|
||||
// easily matched.
|
||||
func (p Path) Matches(other string) bool {
|
||||
return strings.HasPrefix(string(p), other)
|
||||
}
|
Reference in New Issue
Block a user