taotao2014 commented on a change in pull request #1953:
URL: https://github.com/apache/incubator-apisix/pull/1953#discussion_r463493811



##########
File path: apisix/core/request.lua
##########
@@ -94,7 +94,34 @@ function _M.get_remote_client_port(ctx)
         ctx = ngx.ctx.api_ctx
     end
     return tonumber(ctx.var.remote_port)
-  end
+end
+
+function _M.get_scheme(ctx)
+    if not ctx then
+        ctx = ngx.ctx.api_ctx
+    end
+    return ctx.var.scheme or ''
+end
+
+function _M.get_host(ctx)
+    if not ctx then
+        ctx = ngx.ctx.api_ctx
+    end
+    return ctx.var.host or ''
+end
+
+function _M.get_port(ctx)
+    if not ctx then
+        ctx = ngx.ctx.api_ctx
+    end
+    return tonumber(ctx.var.server_port)
+end
+
+function _M.get_http_version()

Review comment:
       Keep the style consistent,user acceptance is easier.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to