Written by

Question omer · Jun 25, 2024

How can i see the request size in kilobytes/megabytes?

I need to be able to take the size of the request from a given %CSP.request

however it seems the best the docs suggest is to get the length of characters in  the request (using $order and Get, Count)...
this is not good enough for what I need to do, Any suggestions?
I scanned the docs and couldn't find anything.

Product version: Caché 2018.1

Comments

Yaron Munz · Jun 26, 2024

I would try to:
1. check if there is a header for "Content-Length" (the client is setting this)
2. As the %CSP.Request is a stream you might try to check it's "size" property
3. Find the global(s) that are storing this request (not sure which, maybe ^%csp.session or some CacheTemp.csp* with the sessionID - would be a bit complex since its not documented.

0
omer  Jun 27, 2024 to Yaron Munz

Thx for the replay, 
1. the problem with checking the header is that it can be toyed with, if someone changes header to say 1kb and sends 4mbs i will check header and let it pass...
I will check about 2 and 3, thx!

EDIT: checked about 2 - something like size property doesn't exist, the maximum you can do with a request is iterate through all the data inside and get its total *length of characters* which is still far from the request size in mbs

0
omer  Jun 27, 2024 to Vitaliy Serdtsev

will do, ty!

0
omer · Jul 4, 2024

I still wasn't able to solve this problem.

0