jiangfucheng commented on issue #9818: URL: https://github.com/apache/apisix/issues/9818#issuecomment-1633893351
> Thanks @qwzhou89 > > That worked, however it adds some problem because `/api02/base64/` is now hardcoded in the `serverless-post-function` and it should be a dynamic value, that is why I was using `regex_uri` in `proxy-rewrite` and having the option of changing that value in `proxy-rewrite`. > > Any idea how I can add that? > > Appreciate your support. Regards. If we still use `proxy-rewrite` plugin rewrite `http://local-apisix/myapi/any-string-value` to ` http://3rd-api/otherapi/any-string-value`. And use lua script only to process base64. code sample(not test yet): ``` local core = require("apisix.core"); local b64 = require("ngx.base64"); local splited_uris = core.utils.split_uri(ctx.var.upstream_uri); ctx.var.upstream_uri = table.concat(splited_uris,"", 1, #splited_uris - 1) .. b64.encode_base64url(splited_uris[#splited_uris]); ``` -- 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]
