File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,9 @@ let dispatch ?allow_origin ?allow_headers ?allow_methods ?allow_credentials
9898 ?allow_methods ?allow_credentials ?origin resp_headers in
9999 let status = Code. status_of_code code in
100100 debug ~v: (if code > = 200 && code < 300 then 1 else 0 ) " Reply computed to %S: %d" path_str code;
101+ debugf ~v: 4 (fun () ->
102+ List. iter (fun (name , value ) -> EzDebug. printf " %s: %s" name value) headers
103+ );
101104 debugf ~v: 3 (fun () ->
102105 let content_type = List. assoc_opt " content-type" resp_headers in
103106 if body <> " " && (content_type = Some " application/json" || content_type = Some " text/plain" ) then
Original file line number Diff line number Diff line change @@ -76,15 +76,18 @@ let connection_handler ?catch ?allow_origin ?allow_headers ?allow_methods
7676 | `http {Answer. code; body; headers =resp_headers } ->
7777 let status = Status. unsafe_of_code code in
7878 debug ~v: (if code > = 200 && code < 300 then 1 else 0 ) " Reply computed to %S: %d" path_str code;
79- debugf ~v: 3 (fun () ->
80- let content_type = List. assoc_opt " content-type" resp_headers in
81- if body <> " " && (content_type = Some " application/json" || content_type = Some " text/plain" ) then
82- EzDebug. printf " Reply content:\n %s" body);
8379 let origin = match allow_origin with
8480 | Some `origin -> StringMap. find_opt " origin" headers
8581 | _ -> None in
8682 let headers = merge_headers_with_default ?allow_origin ?allow_headers
8783 ?allow_methods ?allow_credentials ?origin resp_headers in
84+ debugf ~v: 4 (fun () ->
85+ List. iter (fun (name , value ) -> EzDebug. printf " %s: %s" name value) headers
86+ );
87+ debugf ~v: 3 (fun () ->
88+ let content_type = List. assoc_opt " content-type" resp_headers in
89+ if body <> " " && (content_type = Some " application/json" || content_type = Some " text/plain" ) then
90+ EzDebug. printf " Reply content:\n %s" body);
8891 let headers = Headers. of_list headers in
8992 let body = Option. fold ~none: body ~some: (fun f -> body ^ f) footer in
9093 let len = String. length body in
Original file line number Diff line number Diff line change @@ -77,15 +77,18 @@ let connection_handler ?catch ?allow_origin ?allow_headers ?allow_methods
7777 | `http {Answer. code; body; headers =resp_headers } ->
7878 let status = Status. unsafe_of_code code in
7979 debug ~v: (if code > = 200 && code < 300 then 1 else 0 ) " Reply computed to %S: %d" path_str code;
80- debugf ~v: 3 (fun () ->
81- let content_type = List. assoc_opt " content-type" resp_headers in
82- if body <> " " && (content_type = Some " application/json" || content_type = Some " text/plain" ) then
83- EzDebug. printf " Reply content:\n %s" body);
8480 let origin = match allow_origin with
8581 | Some `origin -> StringMap. find_opt " origin" headers
8682 | _ -> None in
8783 let headers = merge_headers_with_default ?allow_origin ?allow_headers
8884 ?allow_methods ?allow_credentials ?origin resp_headers in
85+ debugf ~v: 4 (fun () ->
86+ List. iter (fun (name , value ) -> EzDebug. printf " %s: %s" name value) headers
87+ );
88+ debugf ~v: 3 (fun () ->
89+ let content_type = List. assoc_opt " content-type" resp_headers in
90+ if body <> " " && (content_type = Some " application/json" || content_type = Some " text/plain" ) then
91+ EzDebug. printf " Reply content:\n %s" body);
8992 let headers = Headers. of_list headers in
9093 let body = Option. fold ~none: body ~some: (fun f -> body ^ f) footer in
9194 let len = String. length body in
You can’t perform that action at this time.
0 commit comments