File tree 1 file changed +16
-13
lines changed
1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -988,8 +988,10 @@ local function httpd_http11_handler(session)
988
988
local proto_name = p .headers [' upgrade' ]:lower ()
989
989
local proto = session .server .upgrades [proto_name ]
990
990
if not proto then
991
- session :write (' HTTP/1.1 400 Bad Request\r\n\r\n ' )
992
- return false
991
+ if not session .server .options .ignore_unknown_upgrade then
992
+ session :write (' HTTP/1.1 400 Bad Request\r\n\r\n ' )
993
+ return false
994
+ end
993
995
else
994
996
local ok , upgrade_ok = pcall (proto .upgrade , session , p )
995
997
if not ok then
@@ -1249,17 +1251,18 @@ local httpd_mt = {
1249
1251
}
1250
1252
1251
1253
local httpd_options_default = {
1252
- max_header_size = 4096 ,
1253
- header_timeout = 100 ,
1254
- handler = handler ,
1255
- app_dir = ' .' ,
1256
- charset = ' utf-8' ,
1257
- cache_templates = true ,
1258
- cache_controllers = true ,
1259
- cache_static = true ,
1260
- log_requests = true ,
1261
- log_errors = true ,
1262
- display_errors = true ,
1254
+ max_header_size = 4096 ,
1255
+ header_timeout = 100 ,
1256
+ handler = handler ,
1257
+ app_dir = ' .' ,
1258
+ charset = ' utf-8' ,
1259
+ cache_templates = true ,
1260
+ cache_controllers = true ,
1261
+ cache_static = true ,
1262
+ log_requests = true ,
1263
+ log_errors = true ,
1264
+ display_errors = true ,
1265
+ ignore_unknown_upgrade = true ,
1263
1266
}
1264
1267
1265
1268
local function httpd_new (host , port , options )
You can’t perform that action at this time.
0 commit comments