Error: AI-Proxy Plugin together with CORS Plugin

I’m currently experimenting with the AI-Proxy plugin being used from a Web App (Flutter Web App inside Chrome). Without CORS I’m getting the browser exception XMLHttpRequest has been blocked by CORS policy.

When I configure the CORS plugin to handle the request for the configured AI-Proxy route I’m getting a client exception for a empty response and in the Kong logs I see the following error (see below). I also checked with wireshark that there is no response to the OPTIONS request from the client browser.

Is there a way to fix this?
(Kong OSS 3.6.1 is used)


kong_1                | 2024/04/22 18:39:29 [error] 1323#0: *3643 failed to run header_filter_by_lua*: /usr/local/share/lua/5.1/kong/plugins/ai-proxy/handler.lua:36: service body is only available with buffered proxying (see: kong.service.request.enable_buffering function)
kong_1                | stack traceback:
kong_1                | 	[C]: in function 'error'
kong_1                | 	/usr/local/share/lua/5.1/kong/pdk/service/response.lua:292: in function 'get_raw_body'
kong_1                | 	/usr/local/share/lua/5.1/kong/plugins/ai-proxy/handler.lua:36: in function </usr/local/share/lua/5.1/kong/plugins/ai-proxy/handler.lua:24>
kong_1                | 	/usr/local/share/lua/5.1/kong/init.lua:461: in function 'execute_collected_plugins_iterator'
kong_1                | 	/usr/local/share/lua/5.1/kong/init.lua:1598: in function 'header_filter'
kong_1                | 	header_filter_by_lua(nginx-kong.conf:105):2: in main chunk, client:, server: kong, request: "OPTIONS /llama3-8b HTTP/1.1", host: "", referrer: "http://localhost:33945/", request_id: "10f41e4ec88cee522d922c4573cc5409"
kong_1                | - - [22/Apr/2024:18:39:29 +0000] "OPTIONS /llama3-8b HTTP/1.1" 200 0 "http://localhost:33945/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36" kong_request_id: "10f41e4ec88cee522d922c4573cc5409"