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

When using FeignClient, an error occurs when a value with a special structure is passed in the header map #2739

Open
tonyKe-Kazi opened this issue Jan 22, 2025 · 0 comments

Comments

@tonyKe-Kazi
Copy link

feign-core:11.8
When the content of my header map is as follows, the following exception is throw
headerMap:
{
"x-test":{"test":["123:861"]}
}
error:
java.util.regex.PatternSyntaxException: Unclosed character class near index 4
["123
^
at java.base/java.util.regex.Pattern.error(Pattern.java:2204)
at java.base/java.util.regex.Pattern.clazz(Pattern.java:2869)
at java.base/java.util.regex.Pattern.sequence(Pattern.java:2315)
at java.base/java.util.regex.Pattern.expr(Pattern.java:2245)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1945)
at java.base/java.util.regex.Pattern.(Pattern.java:1576)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1101)
at feign.template.Expression.lambda$new$0(Expression.java:35)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at feign.template.Expression.(Expression.java:35)
at feign.template.Expressions$SimpleExpression.(Expressions.java:106)
at feign.template.Expressions.create(Expressions.java:86)
at feign.template.Template.parseFragment(Template.java:218)
at feign.template.Template.parseTemplate(Template.java:202)
at feign.template.Template.(Template.java:61)
at feign.template.HeaderTemplate.(HeaderTemplate.java:82)
at feign.template.HeaderTemplate.create(HeaderTemplate.java:48)
at feign.RequestTemplate.lambda$appendHeader$3(RequestTemplate.java:748)
at java.base/java.util.TreeMap.callRemappingFunctionWithCheck(TreeMap.java:792)
at java.base/java.util.TreeMap.compute(TreeMap.java:722)
at feign.RequestTemplate.appendHeader(RequestTemplate.java:746)
at feign.RequestTemplate.header(RequestTemplate.java:708)
at feign.ReflectiveFeign$BuildTemplateByResolvingArgs.addHeaderMapHeaders(ReflectiveFeign.java:294)
at feign.ReflectiveFeign$BuildTemplateByResolvingArgs.create(ReflectiveFeign.java:243)
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:84)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)
at jdk.proxy2/jdk.proxy2.$Proxy144.getOrderDetail(Unknown Source)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant