Commit 22bba80 1 parent 12d1611 commit 22bba80 Copy full SHA for 22bba80
File tree 2 files changed +11
-4
lines changed
jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet
jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 63
63
import org .eclipse .jetty .http .HttpField ;
64
64
import org .eclipse .jetty .http .HttpFields ;
65
65
import org .eclipse .jetty .http .HttpHeader ;
66
+ import org .eclipse .jetty .http .HttpHeaderValue ;
66
67
import org .eclipse .jetty .http .HttpStatus ;
67
68
import org .eclipse .jetty .http .HttpURI ;
68
69
import org .eclipse .jetty .http .HttpVersion ;
@@ -916,9 +917,12 @@ public ServletInputStream getInputStream() throws IOException
916
917
{
917
918
if (_inputState != ServletContextRequest .INPUT_NONE && _inputState != ServletContextRequest .INPUT_STREAM )
918
919
throw new IllegalStateException ("READER" );
920
+
921
+ // Try to write a 100 continue if it is necessary
922
+ if (_inputState == ServletContextRequest .INPUT_NONE && _servletContextRequest .getHeaders ().contains (HttpHeader .EXPECT , HttpHeaderValue .CONTINUE .asString ()))
923
+ _servletChannel .getResponse ().writeInterim (HttpStatus .CONTINUE_100 , HttpFields .EMPTY );
924
+
919
925
_inputState = ServletContextRequest .INPUT_STREAM ;
920
- // Try to write a 100 continue, ignoring failure result if it was not necessary.
921
- _servletChannel .getResponse ().writeInterim (HttpStatus .CONTINUE_100 , HttpFields .EMPTY );
922
926
return getServletRequestInfo ().getHttpInput ();
923
927
}
924
928
Original file line number Diff line number Diff line change @@ -912,9 +912,12 @@ public ServletInputStream getInputStream() throws IOException
912
912
{
913
913
if (_inputState != INPUT_NONE && _inputState != INPUT_STREAM )
914
914
throw new IllegalStateException ("READER" );
915
+
916
+ // Try to write a 100 continue if it is necessary.
917
+ if (_inputState == INPUT_NONE && _coreRequest .getHeaders ().contains (HttpHeader .EXPECT , HttpHeaderValue .CONTINUE .asString ()))
918
+ _channel .getCoreResponse ().writeInterim (HttpStatus .CONTINUE_100 , HttpFields .EMPTY );
919
+
915
920
_inputState = INPUT_STREAM ;
916
- // Try to write a 100 continue, ignoring failure result if it was not necessary.
917
- _channel .getCoreResponse ().writeInterim (HttpStatus .CONTINUE_100 , HttpFields .EMPTY );
918
921
return _input ;
919
922
}
920
923
You can’t perform that action at this time.
0 commit comments