Pact file with multipart-form data fails due to missing "CR" carriage return -
i trying write pact test uses multipartform data. pact doesn't support multipartform data post request out of box forming required post data myself , here looks like
string newline = system.lineseparator(); return "--" + boundary + newline + "content-disposition: form-data; name=\"file\"; filename=\"" + filename + "\"" + newline + "content-type: " + contenttype + newline + "content-transfer-encoding: binary" + newline + newline + filecontent.trim() + newline + "--" + boundary + "--";
when pact runs request @ consumer end above generated data in new line char \r\n (crlf running on windows), when request hits mock server see body contains \n instead of \r\n
causes request mismatch , pact doesn't generate pact file. not sure \r gets stripped off
lets instead \r\n , use \n (which ideally not correct windows system), pact consumer test passes , pact file gets generated, when same request runs @ provider side, fails saying stream not ended properly, ofcourse due incorrect new line character.
i need pact file generated crlf new line character. tried finding carriage return goes missing when request hits mock server hasn't been able find far. deadlock situation 1 part of pact runs crlf , other lf
from wireshark can confirm crlf present in request on route mock server.
Comments
Post a Comment