Skip to content

Commit

Permalink
Merge pull request #477 from pshipton/0.30.1+11.0.14.1
Browse files Browse the repository at this point in the history
Merge jdk-11.0.14.1+1 to the 0.30.1 release and update versions
  • Loading branch information
JasonFengJ9 committed Feb 9, 2022
2 parents 01f8665 + e73270e commit 5c423da
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .jcheck/conf
@@ -1,7 +1,7 @@
[general]
project=jdk-updates
jbs=JDK
version=11.0.14
version=11.0.14.1

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace
Expand Down
2 changes: 1 addition & 1 deletion closed/autoconf/custom-spec.gmk.in
@@ -1,5 +1,5 @@
# ===========================================================================
# (c) Copyright IBM Corp. 2017, 2021 All Rights Reserved
# (c) Copyright IBM Corp. 2017, 2022 All Rights Reserved
# ===========================================================================
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
Expand Down
6 changes: 3 additions & 3 deletions closed/get_j9_source.sh
@@ -1,7 +1,7 @@
#!/bin/bash

# ===========================================================================
# (c) Copyright IBM Corp. 2017, 2021 All Rights Reserved
# (c) Copyright IBM Corp. 2017, 2022 All Rights Reserved
# ===========================================================================
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -57,10 +57,10 @@ declare -A shas
declare -A references

git_urls[openj9]=https://github.com/eclipse-openj9/openj9
branches[openj9]=openj9-0.30.0
branches[openj9]=openj9-0.30.1

git_urls[omr]=https://github.com/eclipse-openj9/openj9-omr
branches[omr]=openj9-0.30.0
branches[omr]=openj9-0.30.1

pflag=false

Expand Down
2 changes: 1 addition & 1 deletion closed/openjdk-tag.gmk
@@ -1 +1 @@
OPENJDK_TAG := jdk-11.0.14+9
OPENJDK_TAG := jdk-11.0.14.1+1
4 changes: 2 additions & 2 deletions make/autoconf/version-numbers
Expand Up @@ -29,11 +29,11 @@
DEFAULT_VERSION_FEATURE=11
DEFAULT_VERSION_INTERIM=0
DEFAULT_VERSION_UPDATE=14
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_PATCH=1
DEFAULT_VERSION_EXTRA1=0
DEFAULT_VERSION_EXTRA2=0
DEFAULT_VERSION_EXTRA3=0
DEFAULT_VERSION_DATE=2022-01-18
DEFAULT_VERSION_DATE=2022-02-08
DEFAULT_VERSION_CLASSFILE_MAJOR=55 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="10 11"
Expand Down
Expand Up @@ -698,8 +698,10 @@ int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, u
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
/* (as used in the GLX_OML_sync_control extension). */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* JDK modification */
#elif defined(__sun__)
#include <inttypes.h>
#elif defined(__sun__) || defined(__digital__)
#elif defined(__digital__)
#include <inttypes.h>
#if defined(__STDC__)
#if defined(__arch64__) || defined(_LP64)
Expand Down
Expand Up @@ -614,10 +614,6 @@ private OutgoingHeaders<Stream<T>> headerFrame(long contentLength) {
if (contentLength > 0) {
h.setHeader("content-length", Long.toString(contentLength));
}
URI uri = request.uri();
if (uri != null) {
h.setHeader("host", Utils.hostString(request));
}
HttpHeaders sysh = filterHeaders(h.build());
HttpHeaders userh = filterHeaders(request.getUserHeaders());
// Filter context restricted from userHeaders
Expand Down
87 changes: 63 additions & 24 deletions test/jdk/java/net/httpclient/SpecialHeadersTest.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, 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
Expand All @@ -25,7 +25,7 @@
* @test
* @summary Verify that some special headers - such as User-Agent
* can be specified by the caller.
* @bug 8203771
* @bug 8203771 8218546
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
Expand Down Expand Up @@ -64,8 +64,6 @@
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -74,13 +72,13 @@
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;

import static java.lang.System.err;
import static java.lang.System.out;
import static java.net.http.HttpClient.Builder.NO_PROXY;
import static java.net.http.HttpClient.Version.HTTP_2;
import static java.nio.charset.StandardCharsets.US_ASCII;
import org.testng.Assert;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;

public class SpecialHeadersTest implements HttpServerAdapters {

Expand Down Expand Up @@ -151,7 +149,11 @@ static String userAgent() {
"USER-AGENT", u -> userAgent(), "HOST", u -> u.getRawAuthority());

@Test(dataProvider = "variants")
void test(String uriString, String headerNameAndValue, boolean sameClient) throws Exception {
void test(String uriString,
String headerNameAndValue,
boolean sameClient)
throws Exception
{
out.println("\n--- Starting ");

int index = headerNameAndValue.indexOf(":");
Expand Down Expand Up @@ -183,21 +185,41 @@ void test(String uriString, String headerNameAndValue, boolean sameClient) throw
assertEquals(resp.statusCode(), 200,
"Expected 200, got:" + resp.statusCode());

String receivedHeaderString = value == null ? null
: resp.headers().firstValue("X-"+key).get();
out.println("Got X-" + key + ": " + resp.headers().allValues("X-"+key));
if (value != null) {
assertEquals(receivedHeaderString, value);
assertEquals(resp.headers().allValues("X-"+key), List.of(value));
boolean isInitialRequest = i == 0;
boolean isSecure = uri.getScheme().equalsIgnoreCase("https");
boolean isHTTP2 = resp.version() == HTTP_2;
boolean isNotH2CUpgrade = isSecure || (sameClient == true && !isInitialRequest);
boolean isDefaultHostHeader = name.equalsIgnoreCase("host") && useDefault;

// By default, HTTP/2 sets the `:authority:` pseudo-header, instead
// of the `Host` header. Therefore, there should be no "X-Host"
// header in the response, except the response to the h2c Upgrade
// request which will have been sent through HTTP/1.1.

if (isDefaultHostHeader && isHTTP2 && isNotH2CUpgrade) {
assertTrue(resp.headers().firstValue("X-" + key).isEmpty());
assertTrue(resp.headers().allValues("X-" + key).isEmpty());
out.println("No X-" + key + " header received, as expected");
} else {
assertEquals(resp.headers().allValues("X-"+key).size(), 0);
String receivedHeaderString = value == null ? null
: resp.headers().firstValue("X-"+key).get();
out.println("Got X-" + key + ": " + resp.headers().allValues("X-"+key));
if (value != null) {
assertEquals(receivedHeaderString, value);
assertEquals(resp.headers().allValues("X-"+key), List.of(value));
} else {
assertEquals(resp.headers().allValues("X-"+key).size(), 0);
}
}

}
}

@Test(dataProvider = "variants")
void testHomeMadeIllegalHeader(String uriString, String headerNameAndValue, boolean sameClient) throws Exception {
void testHomeMadeIllegalHeader(String uriString,
String headerNameAndValue,
boolean sameClient)
throws Exception
{
out.println("\n--- Starting ");
final URI uri = URI.create(uriString);

Expand Down Expand Up @@ -266,22 +288,39 @@ void testAsync(String uriString, String headerNameAndValue, boolean sameClient)
}
HttpRequest request = requestBuilder.build();

boolean isInitialRequest = i == 0;
boolean isSecure = uri.getScheme().equalsIgnoreCase("https");
boolean isNotH2CUpgrade = isSecure || (sameClient == true && !isInitialRequest);
boolean isDefaultHostHeader = name.equalsIgnoreCase("host") && useDefault;

client.sendAsync(request, BodyHandlers.ofString())
.thenApply(response -> {
out.println("Got response: " + response);
out.println("Got body: " + response.body());
assertEquals(response.statusCode(), 200);
return response;})
.thenAccept(resp -> {
String receivedHeaderString = value == null ? null
: resp.headers().firstValue("X-"+key).get();
out.println("Got X-" + key + ": " + resp.headers().allValues("X-"+key));
if (value != null) {
assertEquals(receivedHeaderString, value);
assertEquals(resp.headers().allValues("X-" + key), List.of(value));
// By default, HTTP/2 sets the `:authority:` pseudo-header, instead
// of the `Host` header. Therefore, there should be no "X-Host"
// header in the response, except the response to the h2c Upgrade
// request which will have been sent through HTTP/1.1.

if (isDefaultHostHeader && resp.version() == HTTP_2 && isNotH2CUpgrade) {
assertTrue(resp.headers().firstValue("X-" + key).isEmpty());
assertTrue(resp.headers().allValues("X-" + key).isEmpty());
out.println("No X-" + key + " header received, as expected");
} else {
assertEquals(resp.headers().allValues("X-" + key).size(), 1);
} })
String receivedHeaderString = value == null ? null
: resp.headers().firstValue("X-"+key).get();
out.println("Got X-" + key + ": " + resp.headers().allValues("X-"+key));
if (value != null) {
assertEquals(receivedHeaderString, value);
assertEquals(resp.headers().allValues("X-" + key), List.of(value));
} else {
assertEquals(resp.headers().allValues("X-" + key).size(), 1);
}
}
})
.join();
}
}
Expand Down

0 comments on commit 5c423da

Please sign in to comment.