mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
Also close connection if response's headers contains connection: close (#33)
This commit is contained in:
parent
0c94a8aab0
commit
a5e2e47b17
1 changed files with 4 additions and 1 deletions
|
|
@ -1089,7 +1089,10 @@ let handle_client_ (self:t) (client_sock:Unix.file_descr) : unit =
|
||||||
|
|
||||||
(* how to reply *)
|
(* how to reply *)
|
||||||
let resp r =
|
let resp r =
|
||||||
try Response.output_ oc r
|
try
|
||||||
|
if Headers.get "connection" r.Response.headers = Some"close" then
|
||||||
|
continue := false;
|
||||||
|
Response.output_ oc r
|
||||||
with Sys_error _ -> continue := false
|
with Sys_error _ -> continue := false
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue