apinto icon indicating copy to clipboard operation
apinto copied to clipboard

bug: API操作模板配置插件不生效

Open q343959872 opened this issue 10 months ago • 1 comments
trafficstars

Current Behavior

API操作模板配置的跨域插件,在API中绑定之后没有对接口生效

Expected Behavior

No response

Error Logs

No response

Steps to Reproduce

1、配置API操作模板,添加插件cors,并且增加跨域配置,然后发布 { "allow_credentials": false, "allow_headers": "", "allow_methods": "", "allow_origin": "", "expose_headers": "", "max_age": 5 } 2、在API配置中绑定插件模板,选择添加的跨域操作模板,并且重新发布API 3、通过页面跨域访问该网关API 4、访问还是出现跨域问题

PS. 跨域插件已经排序到最前面,如果节点跨域插件全局开启API是可以跨域访问的,但是只是启用,然后绑定API操作模板插件没有生效 image

Environment

  • APINTO version (run apinto version): 0.19.4
  • Operating system (run uname -a): Linux redgpts04 3.10.0-1160.el7.x86_64 https://github.com/eolinker/apinto/pull/1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

q343959872 avatar Jan 02 '25 06:01 q343959872

你这个跨域插件的配置是有问题的,应该如下配置

{
"allow_credentials": false,
"allow_headers": "",
"allow_methods": "*",
"allow_origin": "*",
"expose_headers": "",
"max_age": 5
}

Dot-Liu avatar Feb 08 '25 08:02 Dot-Liu

我将关闭该Issue,感谢您的反馈

Dot-Liu avatar Sep 28 '25 01:09 Dot-Liu