You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/06/14 00:32:07 UTC

[GitHub] [incubator-apisix] agile6v commented on a change in pull request #1708: add header filter and access phases.

agile6v commented on a change in pull request #1708:
URL: https://github.com/apache/incubator-apisix/pull/1708#discussion_r439780322



##########
File path: apisix/plugins/echo.lua
##########
@@ -70,4 +92,21 @@ function _M.body_filter(conf, ctx)
     ngx.arg[2] = true
 end
 
+function _M.header_filter(conf, ctx)
+    if conf.headers_arr then
+        local field_cnt = #conf.headers_arr
+        for i = 1, field_cnt, 2 do
+            ngx.header[conf.headers_arr[i]] = conf.headers_arr[i+1]
+        end
+    end
+end
+
+function _M.access(conf, ctx)
+    local auth_header = ngx.headers["Authorization"]

Review comment:
       It's best to specify the auth header. 




----------------------------------------------------------------
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.

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