apinto icon indicating copy to clipboard operation
apinto copied to clipboard

bug: 额外参数v2插件携带自定义header参数偶发丢失

Open luoyger opened this issue 1 year ago • 0 comments

Current Behavior

配置了额外参数v2插件,配置信息如下,在上游服务中获取headers,偶发获取不到自定义的header字段

{
    "error_type": "text",
    "params": [{
        "name": "application",
        "position": "header",
        "type": "$concat",
        "value": ["$application"]
    }, {
        "name": "remote_addr",
        "position": "header",
        "type": "$concat",
        "value": ["$remote_addr"]
    }, {
        "name": "uri",
        "position": "header",
        "type": "$concat",
        "value": ["$uri"]
    }],
    "request_body_type": "json"
}

Expected Behavior

No response

Error Logs

在access-log中打印系统变量,有正常输出系统变量值

{
    "fields":[
        "$time_iso8601",
        "$request_id",
        "@request",
        "@proxy",
        "@response",
        "@status_code",
        "@time"
    ],
    "request":[
        "$request_method",
        "$scheme",
        "$request_uri",
        "$host",
        "$header",
        "$remote_addr",
        "$application",
        "$token"
    ],
    "proxy":[
        "$proxy_method",
        "$proxy_scheme",
        "$proxy_uri",
        "$proxy_host",
        "$proxy_header",
        "$proxy_addr"
    ],
    "response":[
        "$response_header"
    ],
    "status_code":[
        "$status",
        "$proxy_status"
    ],
    "time":[
        "$request_time",
        "$response_time"
    ]
}

Steps to Reproduce

重复请求,偶发上游服务接收不到自定义header参数。

Environment

apinto版本信息,有自行修改commit,主要关注tag: v0.14.4

Apinto version: 2023101615-786f44a
Golang version: go version go1.20.3 linux/amd64
Git commit hash: 786f44a6468f89112163d04ad12f11c85400d2e8
Built on: 2023-10-16T07:23:03Z
Built by: gitlab
Built by eosc version: v0.14.4

luoyger avatar Nov 20 '23 11:11 luoyger