8274779: HttpURLConnection: HttpClient and HttpsClient incorrectly check request method when set to POST

Reviewed-by: dfuchs, coffeys, vtewari, michaelm
This commit is contained in:
Evan Whelan 2021-10-21 13:33:21 +00:00 committed by Sean Coffey
parent 60cb27dcda
commit 45ce06c9f3
4 changed files with 177 additions and 2 deletions

View file

@ -307,7 +307,7 @@ public class HttpClient extends NetworkClient {
ret = kac.get(url, null);
if (ret != null && httpuc != null &&
httpuc.streaming() &&
httpuc.getRequestMethod() == "POST") {
"POST".equals(httpuc.getRequestMethod())) {
if (!ret.available()) {
ret.inCache = false;
ret.closeServer();

View file

@ -329,7 +329,7 @@ final class HttpsClient extends HttpClient
ret = (HttpsClient) kac.get(url, sf);
if (ret != null && httpuc != null &&
httpuc.streaming() &&
httpuc.getRequestMethod() == "POST") {
"POST".equals(httpuc.getRequestMethod())) {
if (!ret.available())
ret = null;
}