[mod_magnet] reset for http-response-send-file

reset r->http_status and clear response body for http-response-send-file
called from magnet.attract-response-start-to in order to match
http_response_send_file() behavior to send ETag, replace response body
personal/stbuehler/tests-path
Glenn Strauss 2022-06-09 17:19:33 -04:00
parent f86b448799
commit 9ac5da2720
1 changed files with 2 additions and 0 deletions

View File

@ -517,6 +517,8 @@ static int magnet_stat_field(lua_State *L) {
case 'h': { /* http-response-send-file */
if (0 != strcmp(k.ptr, "http-response-send-file")) break;
request_st * const r = magnet_get_request(L);
r->http_status = 0;
http_response_body_clear(r, 0);
http_response_send_file(r, &sce->name, sce);
lua_pushinteger(L, r->http_status);
return 1;