PGBI / kong-dashboard

Dashboard for managing Kong gateway
MIT License
2.17k stars 390 forks source link

Encounter errors tp add pre-function plugins with lua script content. Syntax check failed. #187

Open nighteblis opened 5 years ago

nighteblis commented 5 years ago

Issue summary

Encounter errors tp add pre-function plugins with lua script content. Syntax check failed.

Your environment

Kong node: http://kong:50001 v0.14.1 — Kong-Dashboard v3.5.0

Docker Env: Client: Version: 17.09.0-ce API version: 1.32 Go version: go1.8.3 Git commit: afdb6d4 Built: Tue Sep 26 22:41:23 2017 OS/Arch: linux/amd64

Server: Version: 17.09.0-ce API version: 1.32 (minimum version 1.12) Go version: go1.8.3 Git commit: afdb6d4 Built: Tue Sep 26 22:42:49 2017 OS/Arch: linux/amd64 Experimental: false

Issue description

Steps:

  1. add service
  2. add route
  3. add plugins on route a. pre-function b. return kong.response.exit(401,"error")

Check failed with giving the message "Error parsing pre-function #1: [string "return kong.response.exit(401"]:1: ')' expected near ''" , that can not add.

Expected behavior

I could add the plugins by using the admin api.

Steps to reproduce

Good to have