Skip to content

How to clear fragment of RequestTemplate (Feign client 11.10)? #3095

Closed

Description

@wwc7654321

When I do
template.target(newTarget);
template.uri(newUri ); in my custom RequestInterceptor ,
I noticed that the origin fragment was kept in final URL (something like https://newTarget/newPath?newQuery=newVal#oldFragment , the oldFragment is not part of newUri).

The best thing I can do is template.uri(newUri +"#"); and I will get https://newTarget/newPath?newQuery=newVal# .
How to fully clear fragment, so I can get https://newTarget/newPath?newQuery=newVal ?

Activity

  1. changed the title [-]How to clear fragment of RequestTemplate (Feign client)?[/-] [+]How to clear fragment of RequestTemplate (Feign client 11.10)?[/+] on Oct 24, 2025
  2. added
    questionGeneral usage or 'how-to' questions
    on May 27, 2026
  3. velo commented on May 27, 2026

    @velo
    Member

    Thanks for the report. This project is community-maintained, and the maintainer won't implement fixes/features directly. If you want this to move forward, please open a pull request with automated tests that cover the change.

  4. hutiefang76 commented on Oct 19, 2026

    @hutiefang76
    Contributor

    I can take this. I’ll cover replacing a URI that previously had a fragment, while keeping the append behavior explicit. I also found that target() decodes an escaped fragment before appending it to the URL; I’ll check that in the same fragment-handling tests.

    I’ll keep the change inside RequestTemplate, with no new public setter.

    AI-assisted investigation and implementation for @hutiefang76.

  5. added a commit that references this issue on Nov 9, 2026
    da84f43
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

    questionGeneral usage or 'how-to' questions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions