1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-09-28 14:30:51 +00:00

HTTP Server: Remove trailing new line else POST log messages will show up with extra blank line [#537]

This commit is contained in:
gnosygnu 2019-08-11 08:02:10 -04:00
parent 2ef6211e87
commit dee491a684
2 changed files with 7 additions and 3 deletions

View File

@ -126,7 +126,11 @@ public class Http_request_parser {
while (true) {
line = Bry_.new_u8(rdr.Read_line());
if (Bry_.Has_at_bgn(line, content_type_boundary)) break;
tmp_bfr.Add(line).Add_byte_nl();
// add \n between lines, but not after last line
if (tmp_bfr.Len_gt_0())
tmp_bfr.Add_byte_nl();
tmp_bfr.Add(line);
}
byte[] val = tmp_bfr.To_bry_and_clear();
post_data_hash.Add(key, val);

View File

@ -41,8 +41,8 @@ public class Http_request_parser_tst {
, "val1"
, "-----------------------------12345678901234--"
)
, fxt.Make_post_data_itm("key0", "val0\n")
, fxt.Make_post_data_itm("key1", "val1\n")
, fxt.Make_post_data_itm("key0", "val0")
, fxt.Make_post_data_itm("key1", "val1")
);
}
@Test public void Type_accept_charset() {