Skip to content

Commit ce47759

Browse files
juzhiyuanliuxiranLiteSunimjoeyjohzchen
authored
sync v2.3 (#1232)
* fix(be): change bodyParams to string to accept any content-type (#1202) * fix: change bodyParams to string to accept any content-type * fix: ci error * fix: change bodyparam to type string in e2e test case * fix: ci Co-authored-by: 琚致远 <[email protected]> * fix: online debug body params support content-type x-www-form-urlencoded (#1201) * fix: online debug body params support content-type x-www-form-urlencoded * fix: body code mirror support different mode * fix: use enum instead of real string * fix: lint error Co-authored-by: 琚致远 <[email protected]> * feat: add tips when plugin type is auth and schemaType is not consumer (#1219) Co-authored-by: 琚致远 <[email protected]> * feat: added E2E test for plugins (#1214) * fix(FE): delete global plugin failed (#1170) * fix: delete global plugin failed * fix: filter disable plugins * fix: update online debug api protocol validation and error msg (#1166) * fix: update validation and msg * Update api/internal/handler/route_online_debug/route_online_debug.go * fix: update refer to code review Co-authored-by: 琚致远 <[email protected]> * feat(cli): Show GitHash for manager-api in branch v2.3 (backport #1162) (#1181) * fix: correct Version and GitHash output for manager-api command (#1162) * bug: fix Version and add GitHash for manager-api command Signed-off-by: imjoey <[email protected]> * feat: git hash support generating .githash for apache release Signed-off-by: imjoey <[email protected]> * feat: Add testcase for the new githash info Signed-off-by: imjoey <[email protected]> * feat: add test case for .githash content validation Signed-off-by: imjoey <[email protected]> * feat: Remove git command dependency for getting git hash Signed-off-by: imjoey <[email protected]> * feat: set VERSION to 2.3 in branch v2.3 Signed-off-by: imjoey <[email protected]> * fix(fe): route search with status (#1205) * fix(fe): route search with status * fix: version and status select box allowclear * fix: remove console * fix: set create_time/update_time as omitempty (#1203) Signed-off-by: imjoey <[email protected]> * fix(FE): service issues (#1209) * fix: omit checks when empty * fix: desc search * fix: omit checks when empty * feat: remove desc search * feat: add create service e2e test * feat: update code * feat: update code * chore: sync json schema from Apache APISIX 2.2 (#1177) * chore: sync json schema from Apache APISIX 2.2 * fix: remove schema of plugins that not enable by default * fix test cases for plugin skywalking which is not enable by default * chore: expose port for control API * fix: control API config * fix yaml format * fix CI failed * fix: log path * fix: log path Co-authored-by: 琚致远 <[email protected]> * fix: well handle with malformed auth token in request header (#1206) (#1210) * fix: not panic if auth token is invalid Signed-off-by: imjoey <[email protected]> * do not record the false in log Signed-off-by: imjoey <[email protected]> Co-authored-by: Joey <[email protected]> * fix: route list search query string (#1197) * fix: route list search qurey string * fix: well handle with malformed auth token in request header (#1206) * fix: not panic if auth token is invalid Signed-off-by: imjoey <[email protected]> * do not record the false in log Signed-off-by: imjoey <[email protected]> * feat: add search lables e2e * feat: add search route labels testcase * feat: update code * Update selector.json * Update search-route.spec.js Co-authored-by: Joey <[email protected]> Co-authored-by: 琚致远 <[email protected]> * feat: init cypress with plugin * style: codes format * feat: added come testcases * feat: use the correct api version * feat: added tip * feat: added tip * feat: added test cases * feat: added disable * feat: added disable * feat: added disable * style: codes format * feat: added ajv formats * feat: remove useless codes Co-authored-by: litesun <[email protected]> Co-authored-by: liuxiran <[email protected]> Co-authored-by: Joey <[email protected]> Co-authored-by: nic-chen <[email protected]> Co-authored-by: nic-chen <[email protected]> * feat: add plugin icon (#1220) * feat: add default plugin img * feat: add plugin edit drawer tips * feat: change icon opacity to 0.2 * feat: add plugin icon * feat: update style Co-authored-by: 琚致远 <[email protected]> Co-authored-by: liuxiran <[email protected]> Co-authored-by: litesun <[email protected]> Co-authored-by: Joey <[email protected]> Co-authored-by: nic-chen <[email protected]> Co-authored-by: nic-chen <[email protected]>
1 parent 72f2195 commit ce47759

File tree

26 files changed

+1708
-228
lines changed

26 files changed

+1708
-228
lines changed

api/internal/handler/route_online_debug/route_online_debug.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (h *Handler) ApplyRoute(r *gin.Engine) {
5252
type ParamsInput struct {
5353
URL string `json:"url,omitempty"`
5454
RequestProtocol string `json:"request_protocol,omitempty"`
55-
BodyParams map[string]string `json:"body_params,omitempty"`
55+
BodyParams string `json:"body_params,omitempty"`
5656
Method string `json:"method,omitempty"`
5757
HeaderParams map[string][]string `json:"header_params,omitempty"`
5858
}
@@ -88,11 +88,11 @@ type HTTPProtocolSupport struct {
8888

8989
func (h *HTTPProtocolSupport) RequestForwarding(c droplet.Context) (interface{}, error) {
9090
paramsInput := c.Input().(*ParamsInput)
91-
bodyParams, _ := json.Marshal(paramsInput.BodyParams)
91+
bodyParams := paramsInput.BodyParams
9292
client := &http.Client{}
9393

9494
client.Timeout = 5 * time.Second
95-
req, err := http.NewRequest(strings.ToUpper(paramsInput.Method), paramsInput.URL, strings.NewReader(string(bodyParams)))
95+
req, err := http.NewRequest(strings.ToUpper(paramsInput.Method), paramsInput.URL, strings.NewReader(bodyParams))
9696
if err != nil {
9797
return &data.SpecCodeResponse{StatusCode: http.StatusInternalServerError}, err
9898
}

api/test/e2e/route_online_debug_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,7 @@ func TestRoute_Online_Debug_Route_With_Body_Params(t *testing.T) {
242242
"url": "` + APISIXInternalUrl + `/hello",
243243
"request_protocol": "http",
244244
"method": "POST",
245-
"body_params": {
246-
"name": "test",
247-
"desc": "online debug route with body params"
248-
}
245+
"body_params": "{\"name\":\"test\",\"desc\":\"online debug route with body params\"}"
249246
}`,
250247
Headers: map[string]string{"Authorization": token},
251248
ExpectStatus: http.StatusOK,

0 commit comments

Comments
 (0)