8204679: HTTP Client refresh

Co-authored-by: Daniel Fuchs <daniel.fuchs@oracle.com>
Co-authored-by: Michael McMahon <michael.x.mcmahon@oracle.com>
Co-authored-by: Pavel Rappo <pavel.rappo@oracle.com>
Reviewed-by: chegar, dfuchs, michaelm
This commit is contained in:
Chris Hegarty 2018-06-20 09:05:57 -07:00
parent 8c5dfa21b3
commit 659fdd8dc4
161 changed files with 8019 additions and 1853 deletions

View file

@ -227,8 +227,8 @@ class ExchangeImpl {
contentLen = -1;
}
if (isHeadRequest()) {
/* HEAD requests should not set a content length by passing it
if (isHeadRequest() || rCode == 304) {
/* HEAD requests or 304 responses should not set a content length by passing it
* through this API, but should instead manually set the required
* headers.*/
if (contentLen >= 0) {
@ -239,7 +239,7 @@ class ExchangeImpl {
}
noContentToSend = true;
contentLen = 0;
} else { /* not a HEAD request */
} else { /* not a HEAD request or 304 response */
if (contentLen == 0) {
if (http10) {
o.setWrappedStream (new UndefLengthOutputStream (this, ros));