-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: optional port for nod schema #10477
Changes from 5 commits
be39c51
74dd11d
25a3c3f
8b9fec0
22d70f6
f0bec6a
24b5e8b
90e4adf
959881c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -398,3 +398,44 @@ location /t { | |
--- error_code: 400 | ||
--- response | ||
{"error_msg":"allOf 1 failed: value should match only one schema, but matches none"} | ||
|
||
|
||
|
||
=== TEST 13: Check node_schema optional port | ||
--- config | ||
location /t { | ||
content_by_lua_block { | ||
local t = require("lib.test_admin").test | ||
headers = {} | ||
headers["X-API-KEY"] = "edd1c9f034335f136f87ad84b625c8f1" | ||
local code, body = t('/apisix/admin/routes/1', | ||
ngx.HTTP_PUT, | ||
{ | ||
uri = "/ip", | ||
upstream = { | ||
type = "roundrobin", | ||
nodes = { | ||
{ host = "httpbin.org", weight = 1,} | ||
} | ||
}, | ||
methods = {"GET"}, | ||
}, nil, headers | ||
) | ||
|
||
if code >= 300 then | ||
ngx.status = code | ||
end | ||
ngx.say(body) | ||
|
||
} | ||
} | ||
--- request | ||
GET /t | ||
--- response_body | ||
passed | ||
|
||
|
||
|
||
=== TEST 14: Test route upstream | ||
--- request | ||
GET /ip | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Revolyssup Would you like to update these test cases? it is better not to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I remove some useless code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should check the response body, like this
|
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.
you could search
127.0.0.1:1980
in the project, and find what uri is betterThere 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.
OK, done. thanks