fix bug in SSE

This commit is contained in:
Simon Cruanes 2022-03-03 15:20:14 -05:00
parent cafa2a5420
commit fb1b1f9975
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -981,7 +981,7 @@ let add_route_server_sent_handler ?accept self route f =
let send_event ?event ?id ?retry ~data () : unit =
send_response_idempotent_();
_opt_iter event ~f:(fun e -> Printf.fprintf oc "data: %s\n" e);
_opt_iter event ~f:(fun e -> Printf.fprintf oc "event: %s\n" e);
_opt_iter id ~f:(fun e -> Printf.fprintf oc "id: %s\n" e);
_opt_iter retry ~f:(fun e -> Printf.fprintf oc "retry: %s\n" e);
let l = String.split_on_char '\n' data in