Skip to content

contextMatcher option, to allow complex context matching rules#31

Open
gil wants to merge 1 commit intodrewzboto:masterfrom
gil:context_matcher
Open

contextMatcher option, to allow complex context matching rules#31
gil wants to merge 1 commit intodrewzboto:masterfrom
gil:context_matcher

Conversation

@gil
Copy link

@gil gil commented Oct 25, 2013

I needed the ability to set custom context matchers, to handle url exceptions instead of exact matches. So I'm sharing my changes, if you think it will also be useful for other users :]

@drewzboto
Copy link
Owner

What if instead of a new contextMatcher option, we just expanded the context option to recognize a function or array of functions as use that as the matching function?

@gil
Copy link
Author

gil commented Oct 25, 2013

Humm, nice!! I didn't think about that because when I implemented the contextMatcher, you hadn't implemented the context array. I just rewrote everything yesterday from your latest version to send the pull request and make it easier to merge. Do you want me to do it here?

@drewzboto
Copy link
Owner

Yeah if could make that change in the PR, that would be awesome. if not, i'll take care of it this week.

@drewzboto drewzboto added this to the 0.2.0 milestone Mar 11, 2014
@yugaljindle
Copy link

Where can I find the documentation for context as function (as mentioned above) ?

Right now, I am stuck with context as exact match - I wish if we had regex match for context as well.

My real-life use case:

  • I want to proxy my / i.e. homepage to a remote php setup but using context as / proxies all the urls which is not intended.

I feel very limited with exact matches instead of regex.

@jbnicolai
Copy link

+1 could either a matching function, or Regexp support for the value of context be supported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants