I'm converting an old app of mine from Chuck to Ch...
# chucker
c
I'm converting an old app of mine from Chuck to Chucker. For some reason in Chucker 3.2.0 the response sizes all say -1B. This wasn't happening in chuck. I did a quick search on github and didn't find anything. Anyone have any ideas?
g
This should be relevant for you: https://github.com/ChuckerTeam/chucker/pull/234 tl;dr: if you see
-1
it means that the
contentLength
is not returned by OkHTTP.
c
@gammax thanks for the response. As someone that's not all that familiar with contentLength... is this a header that my backend should be returning back to me?
g
c
Hm. Okay. Definitely have some digging to do. The header sent from the API is out of my control... but having the sizes there is helpful. I'm checking Charles Proxy and I can see that the header is missing, but Charles does show the size.
g
yeah we discuss a bit about that. We decided to keep the
contentLength
consistent with what OkHTTP was returning to us.
c
Makes sense. I guess it would be nice to be able to configure this though. It's been super nice with Charles + Chuck to be able to take a quick glance and see that "Oh hey, this one payload is 2MB!!!" but now that I upgraded to chucker on this one project, we lost that.
Especially since Charles shows the size... I think it would be nice to be able to opt in. Just my 2 cents.
đź‘Ť 1
Let me know if you think I should file a feature request or something.
@gammax when you said "Correct" and linked the rfc. The rfc doesn't actually recommend it anywhere right? Or am I missing something? đź‘€
g
The RFC is actually “suggesting” it:
Copy code
Aside from the cases defined above, in the absence of
   Transfer-Encoding, an origin server SHOULD send a Content-Length
   header field when the payload body size is known prior to sending the
   complete header section.  This will allow downstream recipients to
   measure transfer progress, know when a received message is complete,
   and potentially reuse the connection for additional requests.
đź‘Ť 1