forked from TrueCloudLab/frostfs-s3-gw
[#672] Fix handling X-Amz-Copy-Source header
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
fdc926e70b
commit
163038b37d
7 changed files with 110 additions and 21 deletions
|
@ -2,11 +2,17 @@ package auth
|
|||
|
||||
import "regexp"
|
||||
|
||||
type regexpSubmatcher struct {
|
||||
type RegexpSubmatcher struct {
|
||||
re *regexp.Regexp
|
||||
}
|
||||
|
||||
func (r *regexpSubmatcher) getSubmatches(target string) map[string]string {
|
||||
// NewRegexpMatcher creates a new regexp sub matcher.
|
||||
func NewRegexpMatcher(re *regexp.Regexp) *RegexpSubmatcher {
|
||||
return &RegexpSubmatcher{re: re}
|
||||
}
|
||||
|
||||
// GetSubmatches returns matches from provided string. Zero length indicates no match.
|
||||
func (r *RegexpSubmatcher) GetSubmatches(target string) map[string]string {
|
||||
matches := r.re.FindStringSubmatch(target)
|
||||
l := len(matches)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue