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.
Since the default class
DefaultinClientusessun.net.www.protocol.http.HttpURLConnection, which has the set of restricted headers, even if I add a header usingRequestTemplate#header(String, String), the actual HTTP request does not contain the header.However
feign.Loggerlogs not the actual request but theRequestmade bySynchronousMethodHandler#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
RequestTemplateyou applied may not be the actual request or, if possible, makeLoggerlogs the actual HTTP request.