apisix-dashboard icon indicating copy to clipboard operation
apisix-dashboard copied to clipboard

bug: echo plugin can not set headers

Open idbeta opened this issue 6 years ago • 3 comments

  • Why do you submit this issue?
  • [ ] Question or discussion
  • [x] Bug
  • [ ] Requirements
  • [ ] Feature or performance improvement
  • [ ] Other

The headers option will automatically refresh as Opthion3 when setting the other option, and the headers option can not be set. image

idbeta avatar Nov 12 '20 07:11 idbeta

There are two errors here:

  1. headers schema should be transformed just like proxy-rewrite and response-rewrite in fe plugin component

  2. echo schema still uses Draft5, that why we will see select element Option1 in page. so It also needs to change the echo shema to Draft7.

{
    "additionalProperties": false,
    "required": ["before_body","body","after_body"],
    "minProperties": 1,
    "properties": {
	"after_body": {
		"description": "body after the modification of filter phase.",
			"type": "string"
		},
		"auth_value": {
			"description": "auth value",
			"type": "string"
		},
		"before_body": {
			"description": "body before the filter phase.",
			"type": "string"
		},
		"body": {
			"description": "body to replace upstream response.",
			"type": "string"
		},
		"headers": {
			"description": "new headers for response",
			"minProperties":1,
			"type": "object"
		}
	},
	"type": "object"
}

liuxiran avatar Nov 12 '20 17:11 liuxiran

fixed by code-mirror

nic-chen avatar Dec 14 '20 06:12 nic-chen

closed by https://github.com/apache/apisix-dashboard/pull/898

juzhiyuan avatar Dec 14 '20 06:12 juzhiyuan