[mod_magnet] ignore 1xx return in response start

ignore 1xx return code from lua in response start phase.

Since response is about to start, send any added/modified headers
along with final response.  (If we did not ignore, then 1xx return
code from lua would incorrectly overwrite the final response status.)
personal/stbuehler/tests-path
Glenn Strauss 2021-08-18 08:01:30 -04:00
parent 3a8b965438
commit 6ed2777204
1 changed files with 2 additions and 1 deletions

View File

@ -2385,7 +2385,8 @@ static handler_t magnet_attract(request_st * const r, plugin_data * const p, scr
}
result = HANDLER_FINISHED;
} else if (lua_return_value >= 100) {
} else if (lua_return_value >= 100 && p->conf.stage != -1) {
/*(skip for response-start; send response as-is w/ added headers)*/
/*(custom lua code should not return 101 Switching Protocols)*/
r->http_status = lua_return_value;
result = http_response_send_1xx(r)