Skip to content

Commit

Permalink
Pass first test
Browse files Browse the repository at this point in the history
  • Loading branch information
Luan van Pletsen committed Apr 10, 2018
1 parent 1e3d7f5 commit 1352a27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apidef/api_definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func (s *StringRegexMap) Check(value string) (bool, string) {
match := s.matchRegex.FindString(value)
if s.notMatchRegex.FindString(value) == "" {
if len(match) > 0 || s.MatchPattern == "" {
return true, match
return true, match
}
}
return false, ""
Expand Down
12 changes: 8 additions & 4 deletions mw_url_rewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,15 @@ func checkHeaderTrigger(r *http.Request, options map[string]apidef.StringRegexMa
vals, ok := r.Header[mhCN]
if ok {
for i, v := range vals {
_, b := mr.Check(v)
if len(b) > 0 {
kn := fmt.Sprintf("trigger-%d-%s-%d", triggernum, mhCN, i)
contextData[kn] = b
triggered, b := mr.Check(v)
println("HEY CAN YOU SEE ME?")
println(triggered)
if triggered {
fCount++
if len(b) > 0 {
kn := fmt.Sprintf("trigger-%d-%s-%d", triggernum, mhCN, i)
contextData[kn] = b
}
}
}
}
Expand Down

0 comments on commit 1352a27

Please sign in to comment.