-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(request-transformer) change HTTP method of upstream request (#1635)
- Loading branch information
1 parent
5bf8833
commit f6b4801
Showing
5 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
local schemas = require "kong.dao.schemas_validation" | ||
local request_transformer_schema = require "kong.plugins.request-transformer.schema" | ||
local validate_entity = schemas.validate_entity | ||
|
||
describe("Plugin: request-transformer (schema)", function() | ||
it("validates http_method", function() | ||
local ok, err = validate_entity({http_method = "GET"}, request_transformer_schema) | ||
assert.is_nil(err) | ||
assert.True(ok) | ||
end) | ||
it("errors invalid http_method", function() | ||
local ok, err = validate_entity({http_method = "HELLO"}, request_transformer_schema) | ||
assert.equal("HELLO is not supported", err.http_method) | ||
assert.False(ok) | ||
end) | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.