File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,10 @@ class Http1ServerRequestHandler : HttpRequestParsingHandler {
9999 }
100100
101101 override bool messageComplete () {
102+ if (! _options.canUpgrade()) {
103+ return true ;
104+ }
105+
102106 try {
103107 if (connection.getUpgradeHttp2Complete() || connection.getUpgradeWebSocketComplete()) {
104108 return true ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class HttpServerOptions : HttpOptions {
2222 private NetServerOptions _netServerOptions;
2323 private HttpRequestOptions _httpRequestOptions;
2424 private ClientAuth clientAuth;
25+ private bool _canUpgrade = true ;
2526
2627 this () {
2728 NetServerOptions netOptions = new NetServerOptions();
@@ -103,7 +104,16 @@ class HttpServerOptions : HttpOptions {
103104 HttpServerOptions setClientAuth (ClientAuth clientAuth) {
104105 this .clientAuth = clientAuth;
105106 return this ;
106- }
107+ }
108+
109+ bool canUpgrade () {
110+ return _canUpgrade;
111+ }
112+
113+ HttpServerOptions canUpgrade (bool value) {
114+ _canUpgrade = value;
115+ return this ;
116+ }
107117
108118 /* ------------------------------ Session APIs ------------------------------ */
109119
You can’t perform that action at this time.
0 commit comments