FIxes #9150 - Use default HttpExchange#setStreams implementation

Right now the JettyHttpExchangeDelegate#setStremas implementation just sets given parameters to respective steams. However, the default JDK implementation of HttpExchange#setStreams calls #ExchangeImpl.setStreams which in turn
only changes the respective streams when given parameters aren't null.
To follow this convention the  JettyHttpExchangeDelegate#setStremas was
rewritten to follow the same convention
This commit is contained in:
Almas Abdrazak 2023-06-11 10:10:11 -07:00 committed by GitHub
parent 082f5e042c
commit c2b9582c5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -209,8 +209,11 @@ public class JettyHttpExchangeDelegate extends HttpExchange
@Override @Override
public void setStreams(InputStream i, OutputStream o) public void setStreams(InputStream i, OutputStream o)
{ {
_is = i; assert _is != null;
_os = o; if (i != null)
_is = i;
if (o != null)
_os = o;
} }
@Override @Override