From 8d401c42cd06f51f38d59ef88a8f2cd1662a51c6 Mon Sep 17 00:00:00 2001 From: Michael-Mc-Mahon Date: Tue, 4 Nov 2025 11:47:28 +0000 Subject: [PATCH 1/8] doc update --- .../com/sun/net/httpserver/HttpExchange.java | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java index ea2845f56f56c..61076ab793454 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -71,6 +71,21 @@ public abstract class HttpExchange implements AutoCloseable, Request { + /* + * Symbolic values for the responseLength parameter of + * sendResponseHeaders(int,long) + */ + + /** + * No response body is being sent with this response + */ + public static final long RSPBODY_EMPTY = -1l; + + /** + * The response body is unspecified and will be chunk encoded + */ + public static final long RSPBODY_CHUNKED = 0; + /** * Constructor for subclasses to call. */ @@ -163,25 +178,26 @@ protected HttpExchange() { */ public abstract OutputStream getResponseBody(); - /** - * Starts sending the response back to the client using the current set of - * response headers and the numeric response code as specified in this + * Starts sending the final response back to the client using the current set of + * response headers obtained from {@link #getResponseHeaders()} and the numeric + * response code as specified in this * method. The response body length is also specified as follows. If the * response length parameter is greater than {@code zero}, this specifies an * exact number of bytes to send and the application must send that exact - * amount of data. If the response length parameter is {@code zero}, then - * chunked transfer encoding is used and an arbitrary amount of data may be + * amount of data. If the response length parameter has the value + * {@link #RSPBODY_CHUNKED} then the response body uses + * chunked transfer encoding and an arbitrary amount of data may be * sent. The application terminates the response body by closing the * {@link OutputStream}. - * If response length has the value {@code -1} then no response body is - * being sent. + * If response length has the value {@link #RSPBODY_EMPTY} then no + * response body is being sent. * *

If the content-length response header has not already been set then * this is set to the appropriate value depending on the response length * parameter. * - *

This method must be called prior to calling {@link #getResponseBody()}. + *

The request body must be consumed before calling this method. * * @implNote This implementation allows the caller to instruct the * server to force a connection close after the exchange terminates, by @@ -193,9 +209,9 @@ protected HttpExchange() { * @param responseLength if {@literal > 0}, specifies a fixed response body * length and that exact number of bytes must be written * to the stream acquired from {@link #getResponseCode()} - * If {@literal == 0}, then chunked encoding is used, + * If equal to {@link #RSPBODY_CHUNKED}, then chunked encoding is used, * and an arbitrary number of bytes may be written. - * If {@literal <= -1}, then no response body length is + * If equal to {@link #RSPBODY_EMPTY}, then no response body length is * specified and no response body may be written. * @throws IOException if the response headers have already been sent or an I/O error occurs * @see HttpExchange#getResponseBody() From 8fe3a2bd9b1f796e1187a54fe61a31de4677e64c Mon Sep 17 00:00:00 2001 From: Michael-Mc-Mahon Date: Tue, 4 Nov 2025 14:04:25 +0000 Subject: [PATCH 2/8] implementation and test --- .../classes/com/sun/net/httpserver/HttpExchange.java | 11 ++++++----- .../classes/sun/net/httpserver/ExchangeImpl.java | 12 +++++++----- test/jdk/com/sun/net/httpserver/BasicAuthToken.java | 5 +++-- test/jdk/com/sun/net/httpserver/EchoHandler.java | 6 ++++-- .../sun/net/httpserver/ExchangeAttributeTest.java | 5 +++-- .../com/sun/net/httpserver/FileServerHandler.java | 12 +++++++----- .../net/httpserver/Http10KeepAliveMaxParamTest.java | 3 ++- test/jdk/com/sun/net/httpserver/HttpServerTest.java | 3 ++- .../httpserver/HttpsParametersClientAuthTest.java | 5 ++--- 9 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java index 61076ab793454..72e814bfa308b 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -180,24 +180,24 @@ protected HttpExchange() { /** * Starts sending the final response back to the client using the current set of - * response headers obtained from {@link #getResponseHeaders()} and the numeric + * response headers obtained from {@link #getResponseHeaders()} and the numeric * response code as specified in this * method. The response body length is also specified as follows. If the * response length parameter is greater than {@code zero}, this specifies an * exact number of bytes to send and the application must send that exact - * amount of data. If the response length parameter has the value + * amount of data. If the response length parameter has the value * {@link #RSPBODY_CHUNKED} then the response body uses * chunked transfer encoding and an arbitrary amount of data may be * sent. The application terminates the response body by closing the * {@link OutputStream}. - * If response length has the value {@link #RSPBODY_EMPTY} then no + * If response length has the value {@link #RSPBODY_EMPTY} then no * response body is being sent. * *

If the content-length response header has not already been set then * this is set to the appropriate value depending on the response length * parameter. * - *

The request body must be consumed before calling this method. + *

This method must be called prior to calling {@link #getResponseBody()}. * * @implNote This implementation allows the caller to instruct the * server to force a connection close after the exchange terminates, by @@ -212,7 +212,8 @@ protected HttpExchange() { * If equal to {@link #RSPBODY_CHUNKED}, then chunked encoding is used, * and an arbitrary number of bytes may be written. * If equal to {@link #RSPBODY_EMPTY}, then no response body length is - * specified and no response body may be written. + * specified and no response body may be written. Any value {@literal <= -1} + * is treated the same as {@link #RSPBODY_EMPTY}. * @throws IOException if the response headers have already been sent or an I/O error occurs * @see HttpExchange#getResponseBody() */ diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/ExchangeImpl.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/ExchangeImpl.java index 0899952b4950f..17dff13d4e51d 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/ExchangeImpl.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/ExchangeImpl.java @@ -38,6 +38,8 @@ import java.time.format.DateTimeFormatter; import java.util.stream.Stream; import com.sun.net.httpserver.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; class ExchangeImpl { @@ -227,12 +229,12 @@ public void sendResponseHeaders (int rCode, long contentLen) ||(rCode == 204) /* no content */ ||(rCode == 304)) /* not modified */ { - if (contentLen != -1) { + if (contentLen != RSPBODY_EMPTY) { String msg = "sendResponseHeaders: rCode = "+ rCode - + ": forcing contentLen = -1"; + + ": forcing contentLen = RSPBODY_EMPTY"; logger.log (Level.WARNING, msg); } - contentLen = -1; + contentLen = RSPBODY_EMPTY; noContentLengthHeader = (rCode != 304); } @@ -249,7 +251,7 @@ public void sendResponseHeaders (int rCode, long contentLen) contentLen = 0; o.setWrappedStream (new FixedLengthOutputStream (this, ros, contentLen)); } else { /* not a HEAD request or 304 response */ - if (contentLen == 0) { + if (contentLen == RSPBODY_CHUNKED) { if (http10) { o.setWrappedStream (new UndefLengthOutputStream (this, ros)); close = true; @@ -258,7 +260,7 @@ public void sendResponseHeaders (int rCode, long contentLen) o.setWrappedStream (new ChunkedOutputStream (this, ros)); } } else { - if (contentLen == -1) { + if (contentLen == RSPBODY_EMPTY) { noContentToSend = true; contentLen = 0; } diff --git a/test/jdk/com/sun/net/httpserver/BasicAuthToken.java b/test/jdk/com/sun/net/httpserver/BasicAuthToken.java index a393ac4c5ddb0..6262f7359a122 100644 --- a/test/jdk/com/sun/net/httpserver/BasicAuthToken.java +++ b/test/jdk/com/sun/net/httpserver/BasicAuthToken.java @@ -39,6 +39,7 @@ import com.sun.net.httpserver.Authenticator; import com.sun.net.httpserver.BasicAuthenticator; import com.sun.net.httpserver.HttpServer; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class BasicAuthToken { private static final String CRLF = "\r\n"; @@ -59,11 +60,11 @@ static HttpServer server() throws Exception { HttpServer server = HttpServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0); server.createContext(someContext, exchange -> { if (authenticator.authenticate(exchange) instanceof Authenticator.Failure) { - exchange.sendResponseHeaders(401, -1); + exchange.sendResponseHeaders(401, RSPBODY_EMPTY); exchange.close(); return; } - exchange.sendResponseHeaders(200, -1); + exchange.sendResponseHeaders(200, RSPBODY_EMPTY); exchange.close(); }).setAuthenticator(authenticator); server.start(); diff --git a/test/jdk/com/sun/net/httpserver/EchoHandler.java b/test/jdk/com/sun/net/httpserver/EchoHandler.java index c3bbea7819527..aef6ed48af628 100644 --- a/test/jdk/com/sun/net/httpserver/EchoHandler.java +++ b/test/jdk/com/sun/net/httpserver/EchoHandler.java @@ -29,6 +29,8 @@ import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; /** * Implements a basic static EchoHandler for an HTTP server @@ -50,9 +52,9 @@ public void handle (HttpExchange t) in = Integer.toString(in.length).getBytes(StandardCharsets.UTF_8); } if (fixedrequest != null) { - t.sendResponseHeaders(200, in.length == 0 ? -1 : in.length); + t.sendResponseHeaders(200, in.length == 0 ? RSPBODY_EMPTY : in.length); } else { - t.sendResponseHeaders(200, 0); + t.sendResponseHeaders(200, RSPBODY_CHUNKED); } os.write(in); close(t, os); diff --git a/test/jdk/com/sun/net/httpserver/ExchangeAttributeTest.java b/test/jdk/com/sun/net/httpserver/ExchangeAttributeTest.java index e7bea2814db03..2b701a0cbc8c6 100644 --- a/test/jdk/com/sun/net/httpserver/ExchangeAttributeTest.java +++ b/test/jdk/com/sun/net/httpserver/ExchangeAttributeTest.java @@ -51,6 +51,7 @@ import java.util.logging.Level; import java.util.logging.Logger; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; import static java.net.http.HttpClient.Builder.NO_PROXY; import static org.junit.jupiter.api.Assertions.*; @@ -117,10 +118,10 @@ public void handle(HttpExchange exchange) throws IOException { } exchange.setAttribute("attr", null); assertNull(exchange.getAttribute("attr")); - exchange.sendResponseHeaders(200, -1); + exchange.sendResponseHeaders(200, RSPBODY_EMPTY); } catch (Throwable t) { t.printStackTrace(); - exchange.sendResponseHeaders(500, -1); + exchange.sendResponseHeaders(500, RSPBODY_EMPTY); } } } diff --git a/test/jdk/com/sun/net/httpserver/FileServerHandler.java b/test/jdk/com/sun/net/httpserver/FileServerHandler.java index 509adf7bf722f..1035ee5c970f3 100644 --- a/test/jdk/com/sun/net/httpserver/FileServerHandler.java +++ b/test/jdk/com/sun/net/httpserver/FileServerHandler.java @@ -25,6 +25,8 @@ import java.net.*; import com.sun.net.httpserver.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; /** * Implements a basic static content HTTP file server handler @@ -65,10 +67,10 @@ public void handle (HttpExchange t) String method = t.getRequestMethod(); if (method.equals ("HEAD")) { rmap.set ("Content-Length", Long.toString (f.length())); - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } else if (!method.equals("GET")) { - t.sendResponseHeaders (405, -1); + t.sendResponseHeaders (405, RSPBODY_EMPTY); t.close(); return; } @@ -84,7 +86,7 @@ public void handle (HttpExchange t) return; } rmap.set ("Content-Type", "text/html"); - t.sendResponseHeaders (200, 0); + t.sendResponseHeaders (200, RSPBODY_CHUNKED); String[] list = f.list(); try (final OutputStream os = t.getResponseBody(); final PrintStream p = new PrintStream (os)) { @@ -127,13 +129,13 @@ void moved (HttpExchange t) throws IOException { String location = "http://"+host+uri.getPath() + "/"; map.set ("Content-Type", "text/html"); map.set ("Location", location); - t.sendResponseHeaders (301, -1); + t.sendResponseHeaders (301, RSPBODY_EMPTY); t.close(); } void notfound (HttpExchange t, String p) throws IOException { t.getResponseHeaders().set ("Content-Type", "text/html"); - t.sendResponseHeaders (404, 0); + t.sendResponseHeaders (404, RSPBODY_CHUNKED); OutputStream os = t.getResponseBody(); String s = "

File not found

"; s = s + p + "

"; diff --git a/test/jdk/com/sun/net/httpserver/Http10KeepAliveMaxParamTest.java b/test/jdk/com/sun/net/httpserver/Http10KeepAliveMaxParamTest.java index 25d809058ff24..7f6f487fa6007 100644 --- a/test/jdk/com/sun/net/httpserver/Http10KeepAliveMaxParamTest.java +++ b/test/jdk/com/sun/net/httpserver/Http10KeepAliveMaxParamTest.java @@ -31,6 +31,7 @@ import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Locale; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; /* * @test @@ -54,7 +55,7 @@ public static void main(final String[] args) throws Exception { final HttpServer server = HttpServer.create(bindAddr, backlog); server.createContext("/", (exchange) -> { System.out.println("Sending response for request " + exchange.getRequestURI()); - exchange.sendResponseHeaders(200, 0); + exchange.sendResponseHeaders(200, RSPBODY_CHUNKED); exchange.getResponseBody().close(); }); server.start(); diff --git a/test/jdk/com/sun/net/httpserver/HttpServerTest.java b/test/jdk/com/sun/net/httpserver/HttpServerTest.java index b272bafc24139..72ed4a5bb21e7 100644 --- a/test/jdk/com/sun/net/httpserver/HttpServerTest.java +++ b/test/jdk/com/sun/net/httpserver/HttpServerTest.java @@ -43,6 +43,7 @@ import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; public class HttpServerTest implements HttpHandler { private static final int HTTP_STATUS_CODE_OK = 200; @@ -66,7 +67,7 @@ public void handle(HttpExchange ex) throws IOException { private void sendHttpStatusCode(int httpCode, HttpExchange ex) { try { - ex.sendResponseHeaders(httpCode, 0); + ex.sendResponseHeaders(httpCode, RSPBODY_CHUNKED); ex.close(); } catch (IOException e) { throw new RuntimeException("Server couldn't send response: " + e, e); diff --git a/test/jdk/com/sun/net/httpserver/HttpsParametersClientAuthTest.java b/test/jdk/com/sun/net/httpserver/HttpsParametersClientAuthTest.java index dc1f573c4e404..c6a44220f503b 100644 --- a/test/jdk/com/sun/net/httpserver/HttpsParametersClientAuthTest.java +++ b/test/jdk/com/sun/net/httpserver/HttpsParametersClientAuthTest.java @@ -54,6 +54,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; import static java.net.http.HttpClient.Builder.NO_PROXY; import static java.net.http.HttpClient.Version.HTTP_1_1; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -392,12 +393,10 @@ public void setSSLParameters(SSLParameters params) { // A HttpHandler which just returns 200 response code private static final class AllOKHandler implements HttpHandler { - private static final int NO_RESPONSE_BODY = -1; - @Override public void handle(final HttpExchange exchange) throws IOException { System.out.println("responding to request: " + exchange.getRequestURI()); - exchange.sendResponseHeaders(200, NO_RESPONSE_BODY); + exchange.sendResponseHeaders(200, RSPBODY_EMPTY); } } } From 5f9f259d8d7883369fa1b7ba35289e1b77675f41 Mon Sep 17 00:00:00 2001 From: Michael-Mc-Mahon Date: Tue, 4 Nov 2025 21:17:30 +0000 Subject: [PATCH 3/8] doc update --- .../com/sun/net/httpserver/HttpExchange.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java index 72e814bfa308b..bbeb747f486de 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -78,11 +78,15 @@ public abstract class HttpExchange implements AutoCloseable, Request { /** * No response body is being sent with this response + * + * @since 26 */ public static final long RSPBODY_EMPTY = -1l; /** * The response body is unspecified and will be chunk encoded + * + * @since 26 */ public static final long RSPBODY_CHUNKED = 0; @@ -186,7 +190,7 @@ protected HttpExchange() { * response length parameter is greater than {@code zero}, this specifies an * exact number of bytes to send and the application must send that exact * amount of data. If the response length parameter has the value - * {@link #RSPBODY_CHUNKED} then the response body uses + * {@link #RSPBODY_CHUNKED} (zero) then the response body uses * chunked transfer encoding and an arbitrary amount of data may be * sent. The application terminates the response body by closing the * {@link OutputStream}. @@ -199,6 +203,14 @@ protected HttpExchange() { * *

This method must be called prior to calling {@link #getResponseBody()}. * + * @apiNote If a response body is to be sent from a byte array and the + * length of the array is used as the responseLength parameter, then note + * the behavior in the case when the array is empty. In that case, the + * responseLength will be zero which is the value of {@link #RSPBODY_CHUNKED} + * resulting in a zero length, but chunked encoded response body. While this + * is not incorrect, it may be preferable to check for an empty array and set + * responseLength to {@link #RSPBODY_EMPTY} instead. + * * @implNote This implementation allows the caller to instruct the * server to force a connection close after the exchange terminates, by * supplying a {@code Connection: close} header to the {@linkplain From f567e10f75625d977cd65b82aef6a68021fa45d5 Mon Sep 17 00:00:00 2001 From: Michael-Mc-Mahon Date: Wed, 5 Nov 2025 11:55:05 +0000 Subject: [PATCH 4/8] revert unintended spec change to sendResponseHeaders --- .../share/classes/com/sun/net/httpserver/HttpExchange.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java index bbeb747f486de..2025602c574a6 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -183,9 +183,8 @@ protected HttpExchange() { public abstract OutputStream getResponseBody(); /** - * Starts sending the final response back to the client using the current set of - * response headers obtained from {@link #getResponseHeaders()} and the numeric - * response code as specified in this + * Starts sending the response back to the client using the current set of + * response headers and the numeric response code as specified in this * method. The response body length is also specified as follows. If the * response length parameter is greater than {@code zero}, this specifies an * exact number of bytes to send and the application must send that exact From df70fb528d21129f728e90088f67b25f92688229 Mon Sep 17 00:00:00 2001 From: Michael-Mc-Mahon Date: Wed, 5 Nov 2025 13:40:17 +0000 Subject: [PATCH 5/8] clarify empty byte[] behavior --- .../share/classes/com/sun/net/httpserver/HttpExchange.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java index 2025602c574a6..8c2a29d9ea40e 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -208,7 +208,9 @@ protected HttpExchange() { * responseLength will be zero which is the value of {@link #RSPBODY_CHUNKED} * resulting in a zero length, but chunked encoded response body. While this * is not incorrect, it may be preferable to check for an empty array and set - * responseLength to {@link #RSPBODY_EMPTY} instead. + * responseLength to {@link #RSPBODY_EMPTY} instead. Also, when sending a + * chunked encoded response body, whatever length, the output stream must + * be explicitly closed by the handler. * * @implNote This implementation allows the caller to instruct the * server to force a connection close after the exchange terminates, by From 5633b0de666c5113ea743dc423cbb0a6c9cf9e6b Mon Sep 17 00:00:00 2001 From: Michael-Mc-Mahon Date: Wed, 5 Nov 2025 15:14:31 +0000 Subject: [PATCH 6/8] update --- .../share/classes/com/sun/net/httpserver/HttpExchange.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java index 8c2a29d9ea40e..acea4c3085ab2 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -79,13 +79,15 @@ public abstract class HttpExchange implements AutoCloseable, Request { /** * No response body is being sent with this response * + * @see #sendResponseHeaders(int, long) * @since 26 */ public static final long RSPBODY_EMPTY = -1l; /** - * The response body is unspecified and will be chunk encoded + * The response body length is unspecified and will be chunk encoded * + * @see #sendResponseHeaders(int, long) * @since 26 */ public static final long RSPBODY_CHUNKED = 0; From 15f4179fc1a584da7de49e4817016e4a692af853 Mon Sep 17 00:00:00 2001 From: Michael-Mc-Mahon Date: Fri, 7 Nov 2025 14:27:43 +0000 Subject: [PATCH 7/8] updated remaining callsites for new constants --- .../com/sun/net/httpserver/HttpHandlers.java | 5 +++-- .../classes/sun/net/httpserver/AuthFilter.java | 5 +++-- .../httpserver/simpleserver/FileServerHandler.java | 13 +++++++------ test/jdk/com/sun/net/httpserver/InputNotRead.java | 7 +++++-- .../sun/net/httpserver/MissingTrailingSpace.java | 3 ++- .../net/httpserver/ServerStopTerminationTest.java | 5 +++-- .../com/sun/net/httpserver/TaskRejectedTest.java | 4 ++-- test/jdk/com/sun/net/httpserver/Test10.java | 3 ++- test/jdk/com/sun/net/httpserver/Test2.java | 3 ++- test/jdk/com/sun/net/httpserver/Test3.java | 3 ++- test/jdk/com/sun/net/httpserver/Test4.java | 3 ++- test/jdk/com/sun/net/httpserver/Test5.java | 3 ++- test/jdk/com/sun/net/httpserver/Test6.java | 3 ++- test/jdk/com/sun/net/httpserver/Test6a.java | 3 ++- test/jdk/com/sun/net/httpserver/Test7.java | 3 ++- test/jdk/com/sun/net/httpserver/Test7a.java | 3 ++- test/jdk/com/sun/net/httpserver/Test8.java | 3 ++- .../bugs/8199849/BasicAuthenticatorCharset.java | 3 ++- .../httpserver/bugs/8199849/TestHttpUnicode.java | 3 ++- .../bugs/8300268/MaxIdleConnectionsTest.java | 3 ++- test/jdk/com/sun/net/httpserver/bugs/B6341616.java | 3 ++- test/jdk/com/sun/net/httpserver/bugs/B6361557.java | 3 ++- test/jdk/com/sun/net/httpserver/bugs/B6393710.java | 3 ++- test/jdk/com/sun/net/httpserver/bugs/B6401598.java | 3 ++- test/jdk/com/sun/net/httpserver/bugs/B6421581.java | 6 ++++-- test/jdk/com/sun/net/httpserver/bugs/B6433018.java | 3 ++- test/jdk/com/sun/net/httpserver/bugs/B6526158.java | 3 ++- test/jdk/com/sun/net/httpserver/bugs/B6526913.java | 3 ++- test/jdk/com/sun/net/httpserver/bugs/B6529200.java | 3 ++- test/jdk/com/sun/net/httpserver/bugs/B6744329.java | 3 ++- test/jdk/com/sun/net/httpserver/bugs/B6886436.java | 3 ++- test/jdk/com/sun/net/httpserver/bugs/B8211420.java | 5 +++-- .../sun/net/httpserver/bugs/ExceptionKeepAlive.java | 7 ++++--- .../net/httpserver/bugs/FixedLengthInputStream.java | 3 ++- .../com/sun/net/httpserver/bugs/HeadKeepAlive.java | 7 ++++--- test/jdk/com/sun/net/httpserver/bugs/HeadTest.java | 5 +++-- .../HttpExchange/AutoCloseableHttpExchange.java | 4 ++-- .../net/httpserver/bugs/TruncatedRequestBody.java | 3 ++- .../net/httpserver/bugs/ZeroLengthOutputStream.java | 3 ++- 39 files changed, 97 insertions(+), 57 deletions(-) diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandlers.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandlers.java index 0364203391401..e9b43040fa3e0 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandlers.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandlers.java @@ -28,6 +28,7 @@ import java.nio.charset.StandardCharsets; import java.util.Objects; import java.util.function.Predicate; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * Implementations of {@link com.sun.net.httpserver.HttpHandler HttpHandler} @@ -155,10 +156,10 @@ public static HttpHandler of(int statusCode, Headers headers, String body) { exchange.getResponseHeaders().putAll(headersCopy); if (exchange.getRequestMethod().equals("HEAD")) { exchange.getResponseHeaders().set("Content-Length", Integer.toString(bytes.length)); - exchange.sendResponseHeaders(statusCode, -1); + exchange.sendResponseHeaders(statusCode, RSPBODY_EMPTY); } else if (bytes.length == 0) { - exchange.sendResponseHeaders(statusCode, -1); + exchange.sendResponseHeaders(statusCode, RSPBODY_EMPTY); } else { exchange.sendResponseHeaders(statusCode, bytes.length); exchange.getResponseBody().write(bytes); diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/AuthFilter.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/AuthFilter.java index a6f03fdc542f1..c65928e18d819 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/AuthFilter.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/AuthFilter.java @@ -27,6 +27,7 @@ import com.sun.net.httpserver.*; import java.io.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class AuthFilter extends Filter { @@ -66,11 +67,11 @@ public void doFilter (HttpExchange t, Filter.Chain chain) throws IOException } else if (r instanceof Authenticator.Retry) { Authenticator.Retry ry = (Authenticator.Retry)r; consumeInput (t); - t.sendResponseHeaders (ry.getResponseCode(), -1); + t.sendResponseHeaders (ry.getResponseCode(), RSPBODY_EMPTY); } else if (r instanceof Authenticator.Failure) { Authenticator.Failure f = (Authenticator.Failure)r; consumeInput (t); - t.sendResponseHeaders (f.getResponseCode(), -1); + t.sendResponseHeaders (f.getResponseCode(), RSPBODY_EMPTY); } } else { chain.doFilter (t); diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java index 6e2683737e601..b4dea96452dfb 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java @@ -43,6 +43,7 @@ import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpHandlers; import static java.nio.charset.StandardCharsets.UTF_8; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * A basic HTTP file server handler for static content. @@ -122,11 +123,11 @@ private void handleSupportedMethod(HttpExchange exchange, Path path, boolean wri private void handleMovedPermanently(HttpExchange exchange) throws IOException { exchange.getResponseHeaders().set("Location", getRedirectURI(exchange.getRequestURI())); - exchange.sendResponseHeaders(301, -1); + exchange.sendResponseHeaders(301, RSPBODY_EMPTY); } private void handleForbidden(HttpExchange exchange) throws IOException { - exchange.sendResponseHeaders(403, -1); + exchange.sendResponseHeaders(403, RSPBODY_EMPTY); } private void handleNotFound(HttpExchange exchange) throws IOException { @@ -139,7 +140,7 @@ private void handleNotFound(HttpExchange exchange) throws IOException { if (exchange.getRequestMethod().equals("HEAD")) { exchange.getResponseHeaders().set("Content-Length", Integer.toString(bytes.length)); - exchange.sendResponseHeaders(404, -1); + exchange.sendResponseHeaders(404, RSPBODY_EMPTY); } else { exchange.sendResponseHeaders(404, bytes.length); try (OutputStream os = exchange.getResponseBody()) { @@ -260,7 +261,7 @@ private void serveDefaultFavIcon(HttpExchange exchange, boolean writeBody) } } else { respHdrs.set("Content-Length", Integer.toString(bytes.length)); - exchange.sendResponseHeaders(200, -1); + exchange.sendResponseHeaders(200, RSPBODY_EMPTY); } } } @@ -280,7 +281,7 @@ private void serveFile(HttpExchange exchange, Path path, boolean writeBody) } } else { respHdrs.set("Content-Length", Long.toString(Files.size(path))); - exchange.sendResponseHeaders(200, -1); + exchange.sendResponseHeaders(200, RSPBODY_EMPTY); } } @@ -298,7 +299,7 @@ private void listFiles(HttpExchange exchange, Path path, boolean writeBody) } } else { respHdrs.set("Content-Length", Integer.toString(bodyBytes.length)); - exchange.sendResponseHeaders(200, -1); + exchange.sendResponseHeaders(200, RSPBODY_EMPTY); } } diff --git a/test/jdk/com/sun/net/httpserver/InputNotRead.java b/test/jdk/com/sun/net/httpserver/InputNotRead.java index 5b67f8d8b24dc..69fdde6ea23cd 100644 --- a/test/jdk/com/sun/net/httpserver/InputNotRead.java +++ b/test/jdk/com/sun/net/httpserver/InputNotRead.java @@ -54,6 +54,7 @@ import org.testng.annotations.Test; import static java.nio.charset.StandardCharsets.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class InputNotRead { @@ -91,7 +92,8 @@ public void handle(HttpExchange msg) throws IOException { try { msg.getRequestBody().read(); try { - msg.sendResponseHeaders(msgCode, reply.length == 0 ? -1 : reply.length); + msg.sendResponseHeaders(msgCode, reply.length == 0 + ? RSPBODY_EMPTY : reply.length); } catch(IOException ioe) { ioe.printStackTrace(); } @@ -132,7 +134,8 @@ public void handle(HttpExchange msg) throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(msg.getRequestBody())); r.read(); try { - msg.sendResponseHeaders(msgCode, reply.length == 0 ? -1 : reply.length); + msg.sendResponseHeaders(msgCode, reply.length == 0 + ? RSPBODY_EMPTY : reply.length); msg.getResponseBody().write(reply); msg.getResponseBody().close(); Thread.sleep(50); diff --git a/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java b/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java index 6671105aac417..8fb3e911ef4cc 100644 --- a/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java +++ b/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java @@ -43,6 +43,7 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class MissingTrailingSpace { @@ -59,7 +60,7 @@ public static void main(String[] args) throws Exception { public void handle(HttpExchange msg) { try { try { - msg.sendResponseHeaders(noMsgCode, -1); + msg.sendResponseHeaders(noMsgCode, RSPBODY_EMPTY); } catch(IOException ioe) { ioe.printStackTrace(); } diff --git a/test/jdk/com/sun/net/httpserver/ServerStopTerminationTest.java b/test/jdk/com/sun/net/httpserver/ServerStopTerminationTest.java index e8f365b715b18..69f4e8742d56b 100644 --- a/test/jdk/com/sun/net/httpserver/ServerStopTerminationTest.java +++ b/test/jdk/com/sun/net/httpserver/ServerStopTerminationTest.java @@ -42,6 +42,7 @@ import java.util.logging.Logger; import static org.junit.jupiter.api.Assertions.fail; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /* * @test @@ -88,7 +89,7 @@ public void setup() throws IOException { try { // Wait for test to signal that we can complete the exchange complete.await(); - exchange.sendResponseHeaders(200, 0); + exchange.sendResponseHeaders(200, RSPBODY_EMPTY); exchange.close(); } catch (final InterruptedException e) { throw new IOException(e); @@ -191,7 +192,7 @@ public void shouldCompeteAfterDelayCustomHandler() throws IOException, Interrupt server = HttpServer.create(new InetSocketAddress(loopbackAddress, 0), 0, "/", exchange -> { - exchange.sendResponseHeaders(200, 0); + exchange.sendResponseHeaders(200, RSPBODY_EMPTY); exchange.close(); }); final Duration executorSleepTime = Duration.ofSeconds(Utils.adjustTimeout(20)); diff --git a/test/jdk/com/sun/net/httpserver/TaskRejectedTest.java b/test/jdk/com/sun/net/httpserver/TaskRejectedTest.java index f3558d95a750b..7b53707142af0 100644 --- a/test/jdk/com/sun/net/httpserver/TaskRejectedTest.java +++ b/test/jdk/com/sun/net/httpserver/TaskRejectedTest.java @@ -44,7 +44,7 @@ import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.Logger; - +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class TaskRejectedTest { @@ -92,7 +92,7 @@ public static void main(String[] args) throws Exception { httpServer.setExecutor(executor); httpServer.createContext(REQUEST_PATH, exc -> { - exc.sendResponseHeaders(200, 0); + exc.sendResponseHeaders(200, RSPBODY_EMPTY); exc.close(); }); diff --git a/test/jdk/com/sun/net/httpserver/Test10.java b/test/jdk/com/sun/net/httpserver/Test10.java index d43480e8b8df4..b45568481fdbc 100644 --- a/test/jdk/com/sun/net/httpserver/Test10.java +++ b/test/jdk/com/sun/net/httpserver/Test10.java @@ -35,6 +35,7 @@ import java.io.*; import java.net.*; import java.util.concurrent.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /* * Test handling of empty Http headers @@ -72,7 +73,7 @@ public void handle (HttpExchange t) InputStream is = t.getRequestBody(); while (is.read() != -1); Headers map = t.getRequestHeaders(); - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/Test2.java b/test/jdk/com/sun/net/httpserver/Test2.java index 1e7710162fd09..22e4a4f2e81bc 100644 --- a/test/jdk/com/sun/net/httpserver/Test2.java +++ b/test/jdk/com/sun/net/httpserver/Test2.java @@ -37,6 +37,7 @@ import java.net.*; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * Test authentication @@ -120,7 +121,7 @@ public void handle (HttpExchange t) Headers rmap = t.getResponseHeaders(); while (is.read () != -1) ; is.close(); - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); HttpPrincipal p = t.getPrincipal (); if (!p.getUsername().equals("fred")) { error = true; diff --git a/test/jdk/com/sun/net/httpserver/Test3.java b/test/jdk/com/sun/net/httpserver/Test3.java index ed5b46781fda3..47ad1a8868a32 100644 --- a/test/jdk/com/sun/net/httpserver/Test3.java +++ b/test/jdk/com/sun/net/httpserver/Test3.java @@ -36,6 +36,7 @@ import java.util.regex.*; import java.io.*; import java.net.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * Test pipe-lining over http @@ -94,7 +95,7 @@ public void handle (HttpExchange t) checkBody (is, body4); break; } - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/Test4.java b/test/jdk/com/sun/net/httpserver/Test4.java index a3502dec22ea6..adaab7d9a14fa 100644 --- a/test/jdk/com/sun/net/httpserver/Test4.java +++ b/test/jdk/com/sun/net/httpserver/Test4.java @@ -36,6 +36,7 @@ import java.util.regex.*; import java.io.*; import java.net.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * Test pipe-lining (block after read) @@ -93,7 +94,7 @@ public void handle (HttpExchange t) checkBody (is, body4); break; } - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/Test5.java b/test/jdk/com/sun/net/httpserver/Test5.java index 68556bbb88887..6f44801782c11 100644 --- a/test/jdk/com/sun/net/httpserver/Test5.java +++ b/test/jdk/com/sun/net/httpserver/Test5.java @@ -36,6 +36,7 @@ import java.util.regex.*; import java.io.*; import java.net.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * Test pipe-lining (no block) @@ -92,7 +93,7 @@ public void handle (HttpExchange t) checkBody (is, body4); break; } - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/Test6.java b/test/jdk/com/sun/net/httpserver/Test6.java index b69bc57b640b2..7b7ce5ee31b83 100644 --- a/test/jdk/com/sun/net/httpserver/Test6.java +++ b/test/jdk/com/sun/net/httpserver/Test6.java @@ -37,6 +37,7 @@ import java.net.*; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * Test POST large file via chunked encoding (unusually small chunks) @@ -107,7 +108,7 @@ public void handle (HttpExchange t) error = true; } is.close(); - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/Test6a.java b/test/jdk/com/sun/net/httpserver/Test6a.java index bbe107f5e2fdd..e36fbc518c221 100644 --- a/test/jdk/com/sun/net/httpserver/Test6a.java +++ b/test/jdk/com/sun/net/httpserver/Test6a.java @@ -40,6 +40,7 @@ import jdk.test.lib.net.SimpleSSLContext; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * Test https POST large file via chunked encoding (unusually small chunks) @@ -115,7 +116,7 @@ public void handle (HttpExchange t) error = true; } is.close(); - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/Test7.java b/test/jdk/com/sun/net/httpserver/Test7.java index 4b99741131644..dace39f2d1201 100644 --- a/test/jdk/com/sun/net/httpserver/Test7.java +++ b/test/jdk/com/sun/net/httpserver/Test7.java @@ -37,6 +37,7 @@ import java.net.*; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * Test POST large file via chunked encoding (large chunks) @@ -106,7 +107,7 @@ public void handle (HttpExchange t) error = true; } is.close(); - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/Test7a.java b/test/jdk/com/sun/net/httpserver/Test7a.java index 5ff01ade9a035..4da101eb996cc 100644 --- a/test/jdk/com/sun/net/httpserver/Test7a.java +++ b/test/jdk/com/sun/net/httpserver/Test7a.java @@ -39,6 +39,7 @@ import javax.net.ssl.*; import jdk.test.lib.net.SimpleSSLContext; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * Test POST large file via chunked encoding (large chunks) @@ -118,7 +119,7 @@ public void handle (HttpExchange t) error = true; } is.close(); - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/Test8.java b/test/jdk/com/sun/net/httpserver/Test8.java index 58f3dc2b3b4c1..cd9953ca1c1eb 100644 --- a/test/jdk/com/sun/net/httpserver/Test8.java +++ b/test/jdk/com/sun/net/httpserver/Test8.java @@ -37,6 +37,7 @@ import java.net.*; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * Test POST large file via fixed len encoding @@ -109,7 +110,7 @@ public void handle (HttpExchange t) error = true; } is.close(); - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java b/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java index 675786242115b..a92d418e5e090 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java +++ b/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java @@ -45,6 +45,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.ISO_8859_1; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * Test authentication @@ -67,7 +68,7 @@ public void handle(HttpExchange t) throws IOException { InputStream is = t.getRequestBody(); while (is.read() != -1) ; is.close(); - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java b/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java index bd608e71ca25c..3c14a14ddcbaf 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java +++ b/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java @@ -35,6 +35,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class TestHttpUnicode { @@ -55,7 +56,7 @@ public void handle(HttpExchange t) throws IOException { HttpPrincipal p = t.getPrincipal(); if (p.getUsername().equals(TEST_USER)) { - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, RSPBODY_EMPTY); } t.close(); } diff --git a/test/jdk/com/sun/net/httpserver/bugs/8300268/MaxIdleConnectionsTest.java b/test/jdk/com/sun/net/httpserver/bugs/8300268/MaxIdleConnectionsTest.java index 3394dc3c6a9c8..6d69c365811c1 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/8300268/MaxIdleConnectionsTest.java +++ b/test/jdk/com/sun/net/httpserver/bugs/8300268/MaxIdleConnectionsTest.java @@ -50,6 +50,7 @@ import java.util.concurrent.atomic.AtomicInteger; import static org.junit.jupiter.api.Assertions.assertTrue; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class MaxIdleConnectionsTest { @@ -132,7 +133,7 @@ private static HttpServer startServer(final CountDownLatch reqFinishedProcessing System.out.println("Request " + exchange.getRequestURI() + " received"); System.out.println("Sending response for request " + exchange.getRequestURI() + " from " + exchange.getRemoteAddress()); reqFinishedProcessing.countDown(); - exchange.sendResponseHeaders(200, 0); + exchange.sendResponseHeaders(200, RSPBODY_CHUNKED); exchange.getResponseBody().close(); }); diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6341616.java b/test/jdk/com/sun/net/httpserver/bugs/B6341616.java index 8a5cb98f29889..38fcbb3f7b7a0 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6341616.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6341616.java @@ -37,6 +37,7 @@ import java.net.*; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class B6341616 { @@ -101,7 +102,7 @@ public void handle (HttpExchange t) Headers rmap = t.getResponseHeaders(); while (is.read () != -1) ; is.close(); - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6361557.java b/test/jdk/com/sun/net/httpserver/bugs/B6361557.java index 66094230d6974..a92bb9adfdc5a 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6361557.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6361557.java @@ -36,6 +36,7 @@ import java.nio.*; import java.nio.channels.*; import java.net.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * The test simply opens 1,000 separate connections @@ -59,7 +60,7 @@ public void handle (HttpExchange t) Headers rmap = t.getResponseHeaders(); while (is.read () != -1) ; is.close(); - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6393710.java b/test/jdk/com/sun/net/httpserver/bugs/B6393710.java index 89170e9aad94a..5240d927401e7 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6393710.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6393710.java @@ -38,6 +38,7 @@ import java.net.*; import jdk.test.lib.Utils; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /* * Test checks for following bug(s) when a POST containing a request body @@ -150,7 +151,7 @@ public void handle (HttpExchange t) ok = false; } is.close(); - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); requests ++; } diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6401598.java b/test/jdk/com/sun/net/httpserver/bugs/B6401598.java index 3a7821dbf5123..f10c17d29d71d 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6401598.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6401598.java @@ -44,6 +44,7 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; public class B6401598 { @@ -66,7 +67,7 @@ public void handle(HttpExchange arg0) throws IOException { DataOutputStream dos = new DataOutputStream(os); - arg0.sendResponseHeaders(200, 0); + arg0.sendResponseHeaders(200, RSPBODY_CHUNKED); dos.writeShort(input); diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6421581.java b/test/jdk/com/sun/net/httpserver/bugs/B6421581.java index 933af30d0843e..621f590a3cb73 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6421581.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6421581.java @@ -31,6 +31,8 @@ import java.net.*; import java.io.*; import java.util.concurrent.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; public class B6421581 { @@ -59,7 +61,7 @@ public void handle(HttpExchange msg) { /* close output stream without opening inpustream */ /* chunked encoding */ try { - msg.sendResponseHeaders(200, 0); + msg.sendResponseHeaders(200, RSPBODY_CHUNKED); OutputStream out = msg.getResponseBody(); out.write("hello".getBytes()); out.close(); @@ -86,7 +88,7 @@ public void handle(HttpExchange msg) { case 3: /* close exchange without opening any stream */ try { - msg.sendResponseHeaders(200, -1); + msg.sendResponseHeaders(200, RSPBODY_EMPTY); msg.close(); } catch(Exception e) { error = true; diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6433018.java b/test/jdk/com/sun/net/httpserver/bugs/B6433018.java index 1a8e52cc34cf8..477ef5d8d2f5c 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6433018.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6433018.java @@ -34,6 +34,7 @@ import java.util.concurrent.*; import java.io.*; import java.net.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class B6433018 { @@ -100,7 +101,7 @@ public void handle(HttpExchange t) throws IOException { Headers rmap = t.getResponseHeaders(); while (is.read() != -1); } - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, RSPBODY_EMPTY); t.close(); finished.countDown(); } diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6526158.java b/test/jdk/com/sun/net/httpserver/bugs/B6526158.java index 5c25911d87aca..1204bd5cbc448 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6526158.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6526158.java @@ -37,6 +37,7 @@ import java.net.*; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class B6526158 { @@ -97,7 +98,7 @@ public void handle (HttpExchange t) e.printStackTrace(); error = true; } - t.sendResponseHeaders (200, -1); + t.sendResponseHeaders (200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6526913.java b/test/jdk/com/sun/net/httpserver/bugs/B6526913.java index de2bd398e33ee..39b92df983e8b 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6526913.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6526913.java @@ -38,6 +38,7 @@ import java.net.*; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; public class B6526913 { @@ -94,7 +95,7 @@ public void handle (HttpExchange t) /* send a chunked response, but wait a while before * sending the final empty chunk */ - t.sendResponseHeaders (200, 0); + t.sendResponseHeaders (200, RSPBODY_CHUNKED); OutputStream os = t.getResponseBody(); byte[] bb = new byte [32 * 1024]; os.write (bb); diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6529200.java b/test/jdk/com/sun/net/httpserver/bugs/B6529200.java index 774eeb93d0df8..c951647af47be 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6529200.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6529200.java @@ -34,6 +34,7 @@ import java.util.concurrent.*; import java.io.*; import java.net.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; public class B6529200 { @@ -127,7 +128,7 @@ public void handle (HttpExchange t) is = t.getRequestBody(); while (is.read() != -1) ; is.close(); - t.sendResponseHeaders (200, 0); + t.sendResponseHeaders (200, RSPBODY_CHUNKED); os = t.getResponseBody(); os.write ("hello world".getBytes()); os.close(); diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6744329.java b/test/jdk/com/sun/net/httpserver/bugs/B6744329.java index 8a6290441ac01..904d6d3f57635 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6744329.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6744329.java @@ -37,6 +37,7 @@ import java.net.*; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; public class B6744329 { @@ -93,7 +94,7 @@ public void handle (HttpExchange t) while (is.read () != -1) ; is.close(); /* chunked response */ - t.sendResponseHeaders (200, 0); + t.sendResponseHeaders (200, RSPBODY_CHUNKED); OutputStream os = t.getResponseBody(); byte[] first = new byte [CHUNK_SIZE * 2]; byte[] second = new byte [2]; diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6886436.java b/test/jdk/com/sun/net/httpserver/bugs/B6886436.java index 050d2b20d5dbd..fa7a2796fd8e8 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6886436.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6886436.java @@ -38,6 +38,7 @@ import java.io.*; import java.net.*; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; public class B6886436 { @@ -96,7 +97,7 @@ public void handle (HttpExchange t) while (is.read () != -1) ; is.close(); // send a 204 response with an empty chunked body - t.sendResponseHeaders (204, 0); + t.sendResponseHeaders (204, RSPBODY_CHUNKED); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/bugs/B8211420.java b/test/jdk/com/sun/net/httpserver/bugs/B8211420.java index 1a322e7945dc6..65e723301ad9f 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B8211420.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B8211420.java @@ -39,6 +39,7 @@ import java.net.*; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class B8211420 { @@ -105,12 +106,12 @@ public void handle (HttpExchange t) is.close(); if (invocation++ == 1) { // send a 204 response with no body - t.sendResponseHeaders(204, -1); + t.sendResponseHeaders(204, RSPBODY_EMPTY); t.close(); } else { // send a 304 response with no body but with content - length rmap.add("Content-length", "99"); - t.sendResponseHeaders(304, -1); + t.sendResponseHeaders(304, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/bugs/ExceptionKeepAlive.java b/test/jdk/com/sun/net/httpserver/bugs/ExceptionKeepAlive.java index ea3ec9cea286d..8fc2d4806965d 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/ExceptionKeepAlive.java +++ b/test/jdk/com/sun/net/httpserver/bugs/ExceptionKeepAlive.java @@ -49,6 +49,7 @@ import java.util.logging.StreamHandler; import static org.junit.jupiter.api.Assertions.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class ExceptionKeepAlive { @@ -111,7 +112,7 @@ public void handle(HttpExchange t) throws IOException { System.out.println("First connection on client port = " + port1); // send response - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, RSPBODY_EMPTY); // response is completed now; throw exception throw new NumberFormatException(); // the connection should still be reusable @@ -120,9 +121,9 @@ public void handle(HttpExchange t) throws IOException { System.out.println("Second connection on client port = " + port2); if (port1 == port2) { - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, RSPBODY_EMPTY); } else { - t.sendResponseHeaders(500, -1); + t.sendResponseHeaders(500, RSPBODY_EMPTY); } } t.close(); diff --git a/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java b/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java index 7df66d8e15eec..35bd33bbca9c2 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java +++ b/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java @@ -45,6 +45,7 @@ import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class FixedLengthInputStream { @@ -132,7 +133,7 @@ public void handle(HttpExchange t) throws IOException { debug("Received " + count + " bytes"); - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, RSPBODY_EMPTY); t.close(); } } diff --git a/test/jdk/com/sun/net/httpserver/bugs/HeadKeepAlive.java b/test/jdk/com/sun/net/httpserver/bugs/HeadKeepAlive.java index cc6fbea90b981..50ee8dbaf2cfe 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/HeadKeepAlive.java +++ b/test/jdk/com/sun/net/httpserver/bugs/HeadKeepAlive.java @@ -48,6 +48,7 @@ import java.util.logging.StreamHandler; import static org.junit.jupiter.api.Assertions.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class HeadKeepAlive { @@ -111,15 +112,15 @@ public void handle(HttpExchange t) throws IOException { port1 = t.getRemoteAddress().getPort(); System.out.println("First connection on client port = " + port1); // send response - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, RSPBODY_EMPTY); // the connection should still be reusable } else if (path.equals("/secondCall")) { int port2 = t.getRemoteAddress().getPort(); System.out.println("Second connection on client port = " + port2); if (port1 == port2) { - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, RSPBODY_EMPTY); } else { - t.sendResponseHeaders(500, -1); + t.sendResponseHeaders(500, RSPBODY_EMPTY); } } t.close(); diff --git a/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java b/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java index b20b786decf12..5c65e90105ab7 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java +++ b/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java @@ -43,6 +43,7 @@ import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; import jdk.test.lib.net.URIBuilder; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class HeadTest { @@ -65,7 +66,7 @@ public void handle(HttpExchange msg) { if (msg.getRequestMethod().equals("HEAD")) { msg.getRequestBody().close(); msg.getResponseHeaders().add("Transfer-encoding", "chunked"); - msg.sendResponseHeaders(200, -1); + msg.sendResponseHeaders(200, RSPBODY_EMPTY); } } catch(IOException ioe) { ioe.printStackTrace(); @@ -84,7 +85,7 @@ public void handle(HttpExchange msg) { if (msg.getRequestMethod().equals("HEAD")) { msg.getRequestBody().close(); msg.getResponseHeaders().add("Content-length", "1024"); - msg.sendResponseHeaders(200, -1); + msg.sendResponseHeaders(200, RSPBODY_EMPTY); } } catch(IOException ioe) { ioe.printStackTrace(); diff --git a/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java b/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java index b25854c592134..dd9da062aa1d0 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java +++ b/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java @@ -33,7 +33,7 @@ import jdk.test.lib.net.URIBuilder; import sun.net.httpserver.HttpExchangeAccess; - +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /** * @test @@ -63,7 +63,7 @@ public void handle(HttpExchange t) throws IOException { InputStream is = t.getRequestBody(); try (HttpExchange e = t) { while (is.read() != -1) ; - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, RSPBODY_EMPTY); } if (!HttpExchangeAccess.isClosed(t)) { exchangeCloseFail.set(true); diff --git a/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java b/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java index 9ceb7108f5cc1..7d13d50ecaa61 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java +++ b/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java @@ -44,6 +44,7 @@ import java.util.logging.ConsoleHandler; import java.util.logging.Level; import java.util.logging.Logger; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; /* * Send two POST requests to the server which are both trucated @@ -75,7 +76,7 @@ public void handle(HttpExchange exch) throws IOException { latch.countDown(); System.out.println("Read " + count + " bytes"); is.close(); - exch.sendResponseHeaders(200, -1); + exch.sendResponseHeaders(200, RSPBODY_EMPTY); } } diff --git a/test/jdk/com/sun/net/httpserver/bugs/ZeroLengthOutputStream.java b/test/jdk/com/sun/net/httpserver/bugs/ZeroLengthOutputStream.java index ff446104e3dd4..937d531e47933 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/ZeroLengthOutputStream.java +++ b/test/jdk/com/sun/net/httpserver/bugs/ZeroLengthOutputStream.java @@ -51,6 +51,7 @@ import java.util.logging.StreamHandler; import static org.junit.jupiter.api.Assertions.*; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; public class ZeroLengthOutputStream { @@ -101,7 +102,7 @@ class MyHandler implements HttpHandler { public void handle(HttpExchange t) throws IOException { try { OutputStream os = t.getResponseBody(); - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, RSPBODY_EMPTY); os.write(new byte[0]); os.close(); System.out.println("Output stream closed"); From 64073c68d9927755b551be014d2d59fad011c432 Mon Sep 17 00:00:00 2001 From: Michael-Mc-Mahon Date: Mon, 10 Nov 2025 12:20:29 +0000 Subject: [PATCH 8/8] Copyright header updates --- .../share/classes/com/sun/net/httpserver/HttpExchange.java | 2 +- .../share/classes/com/sun/net/httpserver/HttpHandlers.java | 2 +- .../share/classes/sun/net/httpserver/AuthFilter.java | 2 +- .../sun/net/httpserver/simpleserver/FileServerHandler.java | 2 +- test/jdk/com/sun/net/httpserver/BasicAuthToken.java | 2 +- test/jdk/com/sun/net/httpserver/EchoHandler.java | 2 +- .../jdk/com/sun/net/httpserver/Http10KeepAliveMaxParamTest.java | 2 +- test/jdk/com/sun/net/httpserver/HttpServerTest.java | 2 +- .../com/sun/net/httpserver/HttpsParametersClientAuthTest.java | 2 +- test/jdk/com/sun/net/httpserver/InputNotRead.java | 2 +- test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java | 2 +- test/jdk/com/sun/net/httpserver/TaskRejectedTest.java | 2 +- test/jdk/com/sun/net/httpserver/Test10.java | 2 +- test/jdk/com/sun/net/httpserver/Test2.java | 2 +- test/jdk/com/sun/net/httpserver/Test3.java | 2 +- test/jdk/com/sun/net/httpserver/Test4.java | 2 +- test/jdk/com/sun/net/httpserver/Test5.java | 2 +- test/jdk/com/sun/net/httpserver/Test6.java | 2 +- test/jdk/com/sun/net/httpserver/Test6a.java | 2 +- test/jdk/com/sun/net/httpserver/Test7.java | 2 +- test/jdk/com/sun/net/httpserver/Test7a.java | 2 +- test/jdk/com/sun/net/httpserver/Test8.java | 2 +- .../net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java | 2 +- .../com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java | 2 +- .../sun/net/httpserver/bugs/8300268/MaxIdleConnectionsTest.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B6341616.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B6393710.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B6401598.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B6421581.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B6433018.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B6526158.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B6526913.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B6529200.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B6744329.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B6886436.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/B8211420.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/ExceptionKeepAlive.java | 2 +- .../jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/HeadKeepAlive.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/HeadTest.java | 2 +- .../httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java | 2 +- test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java | 2 +- .../jdk/com/sun/net/httpserver/bugs/ZeroLengthOutputStream.java | 2 +- 43 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java index acea4c3085ab2..7ea43c0418e30 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandlers.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandlers.java index e9b43040fa3e0..03d5e32f74108 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandlers.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandlers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/AuthFilter.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/AuthFilter.java index c65928e18d819..468fa19fe1652 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/AuthFilter.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/AuthFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java index b4dea96452dfb..3a3654d4a7313 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/BasicAuthToken.java b/test/jdk/com/sun/net/httpserver/BasicAuthToken.java index 6262f7359a122..18d8225f483e6 100644 --- a/test/jdk/com/sun/net/httpserver/BasicAuthToken.java +++ b/test/jdk/com/sun/net/httpserver/BasicAuthToken.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/EchoHandler.java b/test/jdk/com/sun/net/httpserver/EchoHandler.java index aef6ed48af628..b6ee1f23e8783 100644 --- a/test/jdk/com/sun/net/httpserver/EchoHandler.java +++ b/test/jdk/com/sun/net/httpserver/EchoHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/Http10KeepAliveMaxParamTest.java b/test/jdk/com/sun/net/httpserver/Http10KeepAliveMaxParamTest.java index 7f6f487fa6007..c1da7647c4b98 100644 --- a/test/jdk/com/sun/net/httpserver/Http10KeepAliveMaxParamTest.java +++ b/test/jdk/com/sun/net/httpserver/Http10KeepAliveMaxParamTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/HttpServerTest.java b/test/jdk/com/sun/net/httpserver/HttpServerTest.java index 72ed4a5bb21e7..c4be110a26932 100644 --- a/test/jdk/com/sun/net/httpserver/HttpServerTest.java +++ b/test/jdk/com/sun/net/httpserver/HttpServerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/HttpsParametersClientAuthTest.java b/test/jdk/com/sun/net/httpserver/HttpsParametersClientAuthTest.java index c6a44220f503b..37ec2701e07b5 100644 --- a/test/jdk/com/sun/net/httpserver/HttpsParametersClientAuthTest.java +++ b/test/jdk/com/sun/net/httpserver/HttpsParametersClientAuthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/InputNotRead.java b/test/jdk/com/sun/net/httpserver/InputNotRead.java index 69fdde6ea23cd..3d5bfad83c389 100644 --- a/test/jdk/com/sun/net/httpserver/InputNotRead.java +++ b/test/jdk/com/sun/net/httpserver/InputNotRead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java b/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java index 8fb3e911ef4cc..f3759de0f4acf 100644 --- a/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java +++ b/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/TaskRejectedTest.java b/test/jdk/com/sun/net/httpserver/TaskRejectedTest.java index 7b53707142af0..6b6d53fd3a3fc 100644 --- a/test/jdk/com/sun/net/httpserver/TaskRejectedTest.java +++ b/test/jdk/com/sun/net/httpserver/TaskRejectedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/Test10.java b/test/jdk/com/sun/net/httpserver/Test10.java index b45568481fdbc..a256acbca1187 100644 --- a/test/jdk/com/sun/net/httpserver/Test10.java +++ b/test/jdk/com/sun/net/httpserver/Test10.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/Test2.java b/test/jdk/com/sun/net/httpserver/Test2.java index 22e4a4f2e81bc..a61d37eba3a32 100644 --- a/test/jdk/com/sun/net/httpserver/Test2.java +++ b/test/jdk/com/sun/net/httpserver/Test2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/Test3.java b/test/jdk/com/sun/net/httpserver/Test3.java index 47ad1a8868a32..bbb307dc9f275 100644 --- a/test/jdk/com/sun/net/httpserver/Test3.java +++ b/test/jdk/com/sun/net/httpserver/Test3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/Test4.java b/test/jdk/com/sun/net/httpserver/Test4.java index adaab7d9a14fa..ba2f5b4ec825d 100644 --- a/test/jdk/com/sun/net/httpserver/Test4.java +++ b/test/jdk/com/sun/net/httpserver/Test4.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/Test5.java b/test/jdk/com/sun/net/httpserver/Test5.java index 6f44801782c11..68b7d7b357bc3 100644 --- a/test/jdk/com/sun/net/httpserver/Test5.java +++ b/test/jdk/com/sun/net/httpserver/Test5.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/Test6.java b/test/jdk/com/sun/net/httpserver/Test6.java index 7b7ce5ee31b83..737e2cf79c1b7 100644 --- a/test/jdk/com/sun/net/httpserver/Test6.java +++ b/test/jdk/com/sun/net/httpserver/Test6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/Test6a.java b/test/jdk/com/sun/net/httpserver/Test6a.java index e36fbc518c221..676edeb7b60fc 100644 --- a/test/jdk/com/sun/net/httpserver/Test6a.java +++ b/test/jdk/com/sun/net/httpserver/Test6a.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/Test7.java b/test/jdk/com/sun/net/httpserver/Test7.java index dace39f2d1201..1a3497bee48e1 100644 --- a/test/jdk/com/sun/net/httpserver/Test7.java +++ b/test/jdk/com/sun/net/httpserver/Test7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/Test7a.java b/test/jdk/com/sun/net/httpserver/Test7a.java index 4da101eb996cc..90c0615972e6f 100644 --- a/test/jdk/com/sun/net/httpserver/Test7a.java +++ b/test/jdk/com/sun/net/httpserver/Test7a.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/Test8.java b/test/jdk/com/sun/net/httpserver/Test8.java index cd9953ca1c1eb..7097191b7baf5 100644 --- a/test/jdk/com/sun/net/httpserver/Test8.java +++ b/test/jdk/com/sun/net/httpserver/Test8.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java b/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java index a92d418e5e090..8c0936b081f49 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java +++ b/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java b/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java index 3c14a14ddcbaf..9db6cd18bf48e 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java +++ b/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/8300268/MaxIdleConnectionsTest.java b/test/jdk/com/sun/net/httpserver/bugs/8300268/MaxIdleConnectionsTest.java index 6d69c365811c1..191a19f26e3f8 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/8300268/MaxIdleConnectionsTest.java +++ b/test/jdk/com/sun/net/httpserver/bugs/8300268/MaxIdleConnectionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6341616.java b/test/jdk/com/sun/net/httpserver/bugs/B6341616.java index 38fcbb3f7b7a0..8ee085ee69a5d 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6341616.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6341616.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6393710.java b/test/jdk/com/sun/net/httpserver/bugs/B6393710.java index 5240d927401e7..68a3bac259f34 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6393710.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6393710.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6401598.java b/test/jdk/com/sun/net/httpserver/bugs/B6401598.java index f10c17d29d71d..89f07d81630dc 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6401598.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6401598.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6421581.java b/test/jdk/com/sun/net/httpserver/bugs/B6421581.java index 621f590a3cb73..b635cc367690a 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6421581.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6421581.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6433018.java b/test/jdk/com/sun/net/httpserver/bugs/B6433018.java index 477ef5d8d2f5c..1f6876bf87279 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6433018.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6433018.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6526158.java b/test/jdk/com/sun/net/httpserver/bugs/B6526158.java index 1204bd5cbc448..3807b3388bae8 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6526158.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6526158.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6526913.java b/test/jdk/com/sun/net/httpserver/bugs/B6526913.java index 39b92df983e8b..394be75b85da2 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6526913.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6526913.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6529200.java b/test/jdk/com/sun/net/httpserver/bugs/B6529200.java index c951647af47be..62301c84f5f46 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6529200.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6529200.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6744329.java b/test/jdk/com/sun/net/httpserver/bugs/B6744329.java index 904d6d3f57635..3c4a808a2b4f9 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6744329.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6744329.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6886436.java b/test/jdk/com/sun/net/httpserver/bugs/B6886436.java index fa7a2796fd8e8..5081a81c4c13c 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6886436.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6886436.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/B8211420.java b/test/jdk/com/sun/net/httpserver/bugs/B8211420.java index 65e723301ad9f..297aed43bec0a 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B8211420.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B8211420.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/ExceptionKeepAlive.java b/test/jdk/com/sun/net/httpserver/bugs/ExceptionKeepAlive.java index 8fc2d4806965d..865e3b7509d1b 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/ExceptionKeepAlive.java +++ b/test/jdk/com/sun/net/httpserver/bugs/ExceptionKeepAlive.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java b/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java index 35bd33bbca9c2..c2195b3568fe0 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java +++ b/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/HeadKeepAlive.java b/test/jdk/com/sun/net/httpserver/bugs/HeadKeepAlive.java index 50ee8dbaf2cfe..4d987ada173a9 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/HeadKeepAlive.java +++ b/test/jdk/com/sun/net/httpserver/bugs/HeadKeepAlive.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java b/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java index 5c65e90105ab7..452a8060593de 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java +++ b/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java b/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java index dd9da062aa1d0..f9bd802176adb 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java +++ b/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java b/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java index 7d13d50ecaa61..824428755a49f 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java +++ b/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/test/jdk/com/sun/net/httpserver/bugs/ZeroLengthOutputStream.java b/test/jdk/com/sun/net/httpserver/bugs/ZeroLengthOutputStream.java index 937d531e47933..33bbe0479db7b 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/ZeroLengthOutputStream.java +++ b/test/jdk/com/sun/net/httpserver/bugs/ZeroLengthOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it