Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: apisix can't parse cookie #11841

Open
caihonghaoCYF opened this issue Dec 18, 2024 · 1 comment
Open

bug: apisix can't parse cookie #11841

caihonghaoCYF opened this issue Dec 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@caihonghaoCYF
Copy link

Current Behavior

When I use the trafficsplit plugin to split traffic, when my front-end sends a cookie with the value "OnlyHttp;orderNo=F30", it cannot match the normal F30 upstream. When I debugged, I found that apisix parsed this cookie into the key OnlyHttp;orderNo, but the key should actually be orderNo.

Expected Behavior

No response

Error Logs

No response

Steps to Reproduce

  1. craete route
    {
    "update_time": 1732544554,
    "create_time": 1732539917,
    "hosts": [
    "a.test.com"
    ],
    "upstream_id": "734215018329804800",
    "priority": 1,
    "uri": "/e",
    "status": 1,
    "plugins": {
    "client-control": {
    "max_body_size": 4194304
    },
    "traffic-split": {
    "rules": [
    {
    "match": [
    {
    "vars": [
    [
    "cookie_orderNo",
    "==",
    "F30"
    ]
    ]
    }
    ],
    "weighted_upstreams": [
    {
    "weight": 1,
    "upstream_id": "734068621429313536"
    }
    ]
    }
    ]
    }
    },
    "id": "734215018329804800"
    }

  2. Send with cookie "HttpOnly;orderNo=F30"

Environment

  • APISIX version 3.1.0
@dosubot dosubot bot added the bug Something isn't working label Dec 18, 2024
@lynch1981
Copy link

lynch1981 commented Dec 22, 2024

HttpOnly should not appear in the Cookie request header sent by the client.
Instead, it belongs in the Set-Cookie response header.
In the Cookie request header, only the actual key-value pairs should be included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants