Skip to content

ngx.resp.get_headers(): Why is the response header incomplete? #1595

@chenshanyi

Description

@chenshanyi

config:
location =/version {
default_type 'text/plain';

        content_by_lua_file /usr/local/lmrs/lua/api/version.lua;
    
        log_by_lua '
	ngx.log(ngx.ERR,"header: ", require"cjson".encode(ngx.resp.get_headers()))
    ';
    }

request:
curl -i "http://127.0.0.1:8088/version"
HTTP/1.1 200 OK
Server: nginx/1.12.2
Date: Tue, 10 Sep 2019 13:17:46 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
Connection: keep-alive

log:
2019/09/10 09:12:14 [error] 123144#0: *3 [lua] log_by_lua(lmrs.conf:195):2: header: {"transfer-encoding":"chunked","content-type":"text/plain","connection":"close"} while logging request, client: 127.0.0.1, server: , request: "GET /version HTTP/1.1", host: "127.0.0.1:8088"

Why is the response header incomplete?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions