Hi need a help. I'm sending response body from a ...
# help
m
Hi need a help. I'm sending response body from a file using bodyFileName. When I do so, I get '*payload removed due to size*' with 200 response at the client side. I tried few options like setting header size and --use-chunked-encoding but still the same. So reduced the json body file size and now I got the response with body. Any idea if there is body size limit?. The same is working with direct API call.
1
o
I need to look into the code to say for sure
m
It's wiremock standalone which was having initial size of body was 45KB , after reducing it to 3.8KB. it worked. At standalone side I do not see any error message but at the client end it was failing during auto testing. When reduced the size it worked. { "id" : "03bb1808-b4b3-4433-b522-b8639d22d15c", "name" : "display-users-details", "request" : { "url" : "/services/users/details", "method" : "GET" }, "response" : { "status" : 200, "bodyFileName" : "usersdetails.json", "headers" : { "Content-Type" : "application/json;charset=utf-8", "Date" : "Fri, 05 May 2023 132158 GMT" } }, "uuid" : "03bb1808-b4b3-4433-b522-b8639d22d15c" }
I was getting "body: { message: 'payload removed due to size', length: 45226 }" at the client side and wrongly miss read the error is due to file size though it's not an error. but fortunately or unfortunately when I reduced the size of the json file. My client started working.
So I'm curious if there is any limit set on the size of response body sent by wiremock.
o
Most likely yes. I suspect it's a limit on the jetty side but I still need to confirm it
So far I cannot find the repository from where "payload removed due to size" comes from so I am a bit puzzled and need a debugger
Could it be the truncation on the receiver side or maybe on the intelligent proxy side? It would be nice to check what actually WireMock responds on its end
m
please ignore "payload removed due to size" as said it's at the client side. I initially thought its a error but the client have configured to remove body at the logging end. I mis read it as error but luckily it helped in identifying the issue.
👍 1
o
So basically all good, right?
m
yes.
Thank you for looking into it.
o
Happy to help!