OpenFeign / OpenFeign/feign

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

Open
#3,095 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

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 ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing RequestTemplate.target(newTarget) and RequestTemplate.uri(newUri) in the Feign client code, then reproduce the interceptor sequence described in the issue. Done means replacing the target and URI produces a final URL without the original fragment, while preserving the new path and query.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.