Skip to content

Cloudflare proxy drops duplicate upstream response headers (Set-Cookie) #404

Open

Description

@prk-Jr

Raised in review of #379.

crates/edgezero-adapter-cloudflare/src/proxy.rs copies upstream response headers into the proxy response with HeaderMap::insert:

proxy_response
    .headers_mut()
    .insert(header_name, header_value);

When the upstream sends several values for the same header (most importantly multiple Set-Cookie headers), insert replaces earlier values, so only the last one survives. #379 fixed the same bug class for response conversion (response_headers.rs); the proxy path still has it.

Fix: use append instead of insert, and add a contract test proxying a response with two Set-Cookie values.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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