-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adds method matching check to rewrite url captures policy #1253
Conversation
-- Returns true if no Method is provided in the config for backwardscompatibility | ||
local function is_match_methods(methods) | ||
|
||
local request_method = ngx.req.get_method() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this line after the condition, but it's ok if you want to keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes makes sense, not using it in the conditional statement anyway, thanks
@@ -233,3 +233,51 @@ yay, api backend | |||
--- error_code: 200 | |||
--- no_error_log | |||
[error] | |||
|
|||
=== TEST 5: one transformation with method that doesn't match |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add two test that match at least one method:
Test6: One single method works.
Test7: Array with methods [POST, UPDATE, GET] will match if GET method is in there. (Want to check the next method of the array is working)
Adds a list of methods to the transformation. Checks the request method against the method configured in the policy just as it is done in the URL rewrite policy.
Fixes: THREESCALE-6270