Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pathpattern

Package pathpattern provides efficient URL path pattern matching with wildcard support.

It supports exact path matching and wildcard patterns, with protection against path traversal attacks.

Patterns are preprocessed during initialization for better performance.

Basic usage:

go get github.com/aegion-dynamic/pathpattern
import (
    ...
    "github.com/aegion-dynamic/pathpattern",
    ...
)
matcher := pathpattern.New([]string{
    "/public/*",
    "/api/health",
})

if matcher.Matches("/public/file.txt") {
    // handle matched path
}

The library automatically handles path cleaning and normalization, making it safe against path traversal attempts.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages