From 5cff403a698410803ab23c4d58afd74d30ed3f0d Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 14 May 2020 14:57:49 +0200 Subject: [PATCH] Issue #4787 - Make org.eclipse.jetty.client.HttpRequest's host name writable. Made the methods in the interface default so that potential implementers do not break. Signed-off-by: Simone Bordet --- .../java/org/eclipse/jetty/client/api/Request.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java b/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java index a7c9217b44a..1a1ce529cf6 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java @@ -70,7 +70,10 @@ public interface Request * @param host the URI host of this request, such as "127.0.0.1" or "google.com" * @return this request object */ - Request host(String host); + default Request host(String host) + { + return this; + } /** * @return the URI port of this request such as 80 or 443 @@ -78,11 +81,13 @@ public interface Request int getPort(); /** - * * @param port the URI port of this request such as 80 or 443 * @return this request object */ - Request port(int port); + default Request port(int port) + { + return this; + } /** * @return the method of this request, such as GET or POST, as a String