Skip to content

Commit

Permalink
chore: reintroduce martianurl and namespace bff implementation under …
Browse files Browse the repository at this point in the history
…bffurl
  • Loading branch information
imranismail committed Nov 24, 2020
1 parent e72e3cb commit da382f5
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 498 deletions.
64 changes: 0 additions & 64 deletions bffurl/host.go

This file was deleted.

41 changes: 0 additions & 41 deletions bffurl/host_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions bffurl/url_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"github.com/google/martian/v3/parse"
)

var noop = martian.Noop("url.Filter")
var noop = martian.Noop("bffurl.Filter")

func init() {
parse.Register("url.Filter", filterFromJSON)
parse.Register("bffurl.Filter", filterFromJSON)
}

// Filter runs modifiers iff the request URL matches all of the segments in url.
Expand Down
3 changes: 2 additions & 1 deletion bffurl/url_matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"net/url"

"github.com/google/martian/v3/log"
"github.com/google/martian/v3/martianurl"
)

// Matcher is a conditional evaluator of request urls to be used in
Expand Down Expand Up @@ -65,7 +66,7 @@ func (m *Matcher) matches(r *http.Request) bool {
switch {
case m.url.Scheme != "" && m.url.Scheme != r.URL.Scheme:
return false
case m.url.Host != "" && !MatchHost(r.URL.Host, m.url.Host):
case m.url.Host != "" && !martianurl.MatchHost(r.URL.Host, m.url.Host):
return false
case m.url.Path != "" && !m.pattern.Match(r):
return false
Expand Down
2 changes: 1 addition & 1 deletion bffurl/url_modifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type modifierJSON struct {
}

func init() {
parse.Register("url.Modifier", modifierFromJSON)
parse.Register("bffurl.Modifier", modifierFromJSON)
}

// ModifyRequest sets the fields of req.URL to m.Url if they are not the zero value.
Expand Down
93 changes: 0 additions & 93 deletions bffurl/url_regex_filter.go

This file was deleted.

Loading

0 comments on commit da382f5

Please sign in to comment.