Skip to content

Commit

Permalink
sync v2.3 (#1232)
Browse files Browse the repository at this point in the history
* 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: 琚致远 <juzhiyuan@apache.org>

* 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: 琚致远 <juzhiyuan@apache.org>

* feat: add tips when plugin type is auth and schemaType is not consumer (#1219)

Co-authored-by: 琚致远 <juzhiyuan@apache.org>

* 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: 琚致远 <juzhiyuan@apache.org>

* 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 <majunjiev@gmail.com>

* feat: git hash support generating .githash for apache release

Signed-off-by: imjoey <majunjiev@gmail.com>

* feat: Add testcase for the new githash info

Signed-off-by: imjoey <majunjiev@gmail.com>

* feat: add test case for .githash content validation

Signed-off-by: imjoey <majunjiev@gmail.com>

* feat: Remove git command dependency for getting git hash

Signed-off-by: imjoey <majunjiev@gmail.com>

* feat: set VERSION to 2.3 in branch v2.3

Signed-off-by: imjoey <majunjiev@gmail.com>

* 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 <majunjiev@gmail.com>

* 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: 琚致远 <juzhiyuan@apache.org>

* fix: well handle with malformed auth token in request header (#1206) (#1210)

* fix: not panic if auth token is invalid

Signed-off-by: imjoey <majunjiev@gmail.com>

* do not record the false in log

Signed-off-by: imjoey <majunjiev@gmail.com>

Co-authored-by: Joey <majunjiev@gmail.com>

* 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 <majunjiev@gmail.com>

* do not record the false in log

Signed-off-by: imjoey <majunjiev@gmail.com>

* 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 <majunjiev@gmail.com>
Co-authored-by: 琚致远 <juzhiyuan@apache.org>

* 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 <sunyi@apache.org>
Co-authored-by: liuxiran <belovedxixi@126.com>
Co-authored-by: Joey <majunjiev@gmail.com>
Co-authored-by: nic-chen <johz@163.com>
Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com>

* 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: 琚致远 <juzhiyuan@apache.org>

Co-authored-by: liuxiran <belovedxixi@126.com>
Co-authored-by: litesun <sunyi@apache.org>
Co-authored-by: Joey <majunjiev@gmail.com>
Co-authored-by: nic-chen <johz@163.com>
Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com>
  • Loading branch information
6 people authored Jan 7, 2021
1 parent 72f2195 commit ce47759
Show file tree
Hide file tree
Showing 26 changed files with 1,708 additions and 228 deletions.
6 changes: 3 additions & 3 deletions api/internal/handler/route_online_debug/route_online_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (h *Handler) ApplyRoute(r *gin.Engine) {
type ParamsInput struct {
URL string `json:"url,omitempty"`
RequestProtocol string `json:"request_protocol,omitempty"`
BodyParams map[string]string `json:"body_params,omitempty"`
BodyParams string `json:"body_params,omitempty"`
Method string `json:"method,omitempty"`
HeaderParams map[string][]string `json:"header_params,omitempty"`
}
Expand Down Expand Up @@ -88,11 +88,11 @@ type HTTPProtocolSupport struct {

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

client.Timeout = 5 * time.Second
req, err := http.NewRequest(strings.ToUpper(paramsInput.Method), paramsInput.URL, strings.NewReader(string(bodyParams)))
req, err := http.NewRequest(strings.ToUpper(paramsInput.Method), paramsInput.URL, strings.NewReader(bodyParams))
if err != nil {
return &data.SpecCodeResponse{StatusCode: http.StatusInternalServerError}, err
}
Expand Down
5 changes: 1 addition & 4 deletions api/test/e2e/route_online_debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,7 @@ func TestRoute_Online_Debug_Route_With_Body_Params(t *testing.T) {
"url": "` + APISIXInternalUrl + `/hello",
"request_protocol": "http",
"method": "POST",
"body_params": {
"name": "test",
"desc": "online debug route with body params"
}
"body_params": "{\"name\":\"test\",\"desc\":\"online debug route with body params\"}"
}`,
Headers: map[string]string{"Authorization": token},
ExpectStatus: http.StatusOK,
Expand Down
Loading

0 comments on commit ce47759

Please sign in to comment.