Logger logs unsent request headers even though Default in Client has restricted headers · Issue #2682 · OpenFeign/feign · GitHub
Skip to content

Logger logs unsent request headers even though Default in Client has restricted headers #2682

Open

Description

@facewise

Since the default class Default in Client uses sun.net.www.protocol.http.HttpURLConnection, which has the set of restricted headers, even if I add a header using RequestTemplate#header(String, String), the actual HTTP request does not contain the header.

However feign.Logger logs not the actual request but the Request made by SynchronousMethodHandler#executeAndDecode(), which contains the restricted header I have added.

This inconsistency made me hard to discover the problem because there's no such documentation tells the logged request may not be the same as the actual HTTP request.

I hope to add some documentation that tells RequestTemplate you applied may not be the actual request or, if possible, make Logger logs the actual HTTP request.

Activity

  1. added
    documentationIssues that require updates to our documentation
    enhancementFor recommending new capabilities
    on Jun 18, 2026
  2. velo commented on Jun 18, 2026

    @velo
    Member

    Thanks, this is a fair documentation/API-observability gap: Logger sees Feign's Request, while the JDK client may still drop restricted headers before bytes go over the wire.

    A docs PR that calls out that distinction would be welcome. If someone wants to change runtime logging instead, please keep it additive and covered with tests, since the actual sent request can be client-specific.

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

    documentationIssues that require updates to our documentationenhancementFor recommending new capabilities

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions