File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,10 @@ class Http1ServerRequestHandler : HttpRequestParsingHandler {
99
99
}
100
100
101
101
override bool messageComplete () {
102
+ if (! _options.canUpgrade()) {
103
+ return true ;
104
+ }
105
+
102
106
try {
103
107
if (connection.getUpgradeHttp2Complete() || connection.getUpgradeWebSocketComplete()) {
104
108
return true ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class HttpServerOptions : HttpOptions {
22
22
private NetServerOptions _netServerOptions;
23
23
private HttpRequestOptions _httpRequestOptions;
24
24
private ClientAuth clientAuth;
25
+ private bool _canUpgrade = true ;
25
26
26
27
this () {
27
28
NetServerOptions netOptions = new NetServerOptions();
@@ -103,7 +104,16 @@ class HttpServerOptions : HttpOptions {
103
104
HttpServerOptions setClientAuth (ClientAuth clientAuth) {
104
105
this .clientAuth = clientAuth;
105
106
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
+ }
107
117
108
118
/* ------------------------------ Session APIs ------------------------------ */
109
119
You can’t perform that action at this time.
0 commit comments