starsz commented on a change in pull request #6270:
URL: https://github.com/apache/apisix/pull/6270#discussion_r802322836



##########
File path: apisix/plugins/openid-connect.lua
##########
@@ -317,6 +323,13 @@ function _M.rewrite(plugin_conf, ctx)
                 core.request.set_header(ctx, "X-Userinfo",
                     ngx_encode_base64(core.json.encode(response.user)))
             end
+            -- Add X-Userinfo-Detail header, maybe.
+            if response.user and conf.set_userinfo_detail_header then
+                for k in string.gmatch(conf.scope..' ', '(.-)'..' ')

Review comment:
       ```suggestion
                   for k in string.gmatch(conf.scope .. ' ', '(.-)' .. ' ')
   ```

##########
File path: apisix/plugins/openid-connect.lua
##########
@@ -317,6 +323,13 @@ function _M.rewrite(plugin_conf, ctx)
                 core.request.set_header(ctx, "X-Userinfo",
                     ngx_encode_base64(core.json.encode(response.user)))
             end
+            -- Add X-Userinfo-Detail header, maybe.
+            if response.user and conf.set_userinfo_detail_header then
+                for k in string.gmatch(conf.scope..' ', '(.-)'..' ')
+                do
+                    core.request.set_header(ctx, 
'X-Userinfo-Detail-'..k,response.user[k])

Review comment:
       ```suggestion
                       core.request.set_header(ctx, 'X-Userinfo-Detail-' .. k, 
response.user[k])
   ```




-- 
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: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to