Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/697#discussion_r67285947
  
    --- Diff: plugins/experimental/ts_lua/ts_lua_server_request.c ---
    @@ -258,10 +286,27 @@ ts_lua_server_request_get_headers(lua_State *L)
       while (field_loc) {
         name = TSMimeHdrFieldNameGet(http_ctx->server_request_bufp, 
http_ctx->server_request_hdrp, field_loc, &name_len);
         if (name && name_len) {
    -      value = TSMimeHdrFieldValueStringGet(http_ctx->server_request_bufp, 
http_ctx->server_request_hdrp, field_loc, -1, &value_len);
           lua_pushlstring(L, name, name_len);
    -      lua_pushlstring(L, value, value_len);
    -      lua_rawset(L, -3);
    +      lua_gettable(L, -2);
    +      if (lua_isnil(L, -1)) {
    --- End diff --
    
    This definitely needs explanatory comments. I think what is going on is 
that  the first ``lua_pushlstring`` is used to test whether there is already a 
value fir this header. If there is you concat to it. But it needs explanations 
:)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to