xxoxx opened a new issue, #10759:
URL: https://github.com/apache/apisix/issues/10759
### Description
Here is my serverless-pre-function code:
```
{
"_meta": {
"disable": false
},
"functions": [
"return function(conf, ctx) local core =
require(\"apisix.core\"); local function get_cookie_value(cookie_str,
cookie_name) local pattern = cookie_name .. \"=([^;]+)\" return
(cookie_str:match(pattern)) end local cookie_str = core.request.header(ctx,
\"Cookie\") or \"\"; local specific_cookie_value = get_cookie_value(cookie_str,
\"testcookie\");core.request.set_header(\"Authorization\",
specific_cookie_value); core.request.set_header(\"authoxxxx\",
specific_cookie_value); core.response.set_header(\"Set-Cookie\",
\"testcookie=ab13331c; path=/; domain=; expires=\"); end"
],
"phase": "access"
}
```
The aim of this implementation is to capture a specific value from the
cookie and forward it to the backend by setting it in the Authorization header.
This approach is an attempt to address the issue found at
https://github.com/apache/apisix/issues/10247.
After conducting tests on the backend, I found that the authoxxxx header is
successfully sent, but the Authorization header is not being transmitted. How
can I resolve this issue?
### Environment
- APISIX version (run `apisix version`): 3.5.0
- Operating system (run `uname -a`):
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl
http://127.0.0.1:9090/v1/server_info`): 3.4.0
--
<br class="Apple-interchange-newline">
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]