Skip to content

Commit

Permalink
Make ReactiveClientHeadersFactory backward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
michalszynkiewicz authored and gsmet committed Mar 8, 2022
1 parent 849472d commit 995d9d1
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,23 @@ public abstract class ReactiveClientHeadersFactory implements ClientHeadersFacto
*
* @see ClientHeadersFactory#update(MultivaluedMap, MultivaluedMap)
*/
public abstract Uni<MultivaluedMap<String, String>> getHeaders(MultivaluedMap<String, String> incomingHeaders,
MultivaluedMap<String, String> clientOutgoingHeaders);
public Uni<MultivaluedMap<String, String>> getHeaders(MultivaluedMap<String, String> incomingHeaders,
MultivaluedMap<String, String> clientOutgoingHeaders) {
return getHeaders(incomingHeaders);
}

/**
* @deprecated Will be removed in Quarkus 2.8. Implement and use
* {@link ReactiveClientHeadersFactory#getHeaders(MultivaluedMap, MultivaluedMap)} instead
*
* @param incomingHeaders the map of headers from the inbound JAX-RS request. This will be an empty map if the
* associated client interface is not part of a JAX-RS request.
* @return a Uni with a map of HTTP headers to merge with the clientOutgoingHeaders to be sent to the remote service.
*/
@Deprecated
public Uni<MultivaluedMap<String, String>> getHeaders(MultivaluedMap<String, String> incomingHeaders) {
throw new IllegalStateException(getClass() + " does not implement either of the getHeaders() methods");
}

@Override
public final MultivaluedMap<String, String> update(MultivaluedMap<String, String> incomingHeaders,
Expand Down

0 comments on commit 995d9d1

Please sign in to comment.