ReadCGI() no return size

Post bugreports for the Linux version here
acidorus
New User
New User
Posts: 1
Joined: Mon Apr 29, 2024 10:06 pm

ReadCGI() no return size

Post by acidorus »

Hello, from version 6.21, 630, readCGI no longer returns the size and no longer reads a Json sent via POST.
In version 6.20 it works perfectly.

Code: Select all

curl --location 'https://site.com/rep-bin/get' \
--header 'Content-Type: application/json' \
--data '{
    "rep": {
      "data": ["2023-04-20"]
    }
}'
ex:

Code: Select all

 If Not InitCGI()
    End
  EndIf
  
  Define BufferSize = ReadCGI()
  Define httpContentLength = Val(Trim(CGIVariable(#PB_CGI_ContentLength)))
  Define *buff=CGIBuffer()
  
  WriteCGIHeader(#PB_CGI_HeaderContentType, "text/html", #PB_CGI_LastHeader) ; Write the headers to inform the browser of the content format

  WriteCGIString("<html><title>PureBasic - raw buffer</title><body>")  
 
  If *buff
    WriteCGIString("Raw buffer content: <br><pre>"+Str(*buff)+" > "+Str(httpContentLength)+" > " +Str(BufferSize)+" > "+ PeekS(*buff, BufferSize, #PB_Ascii) + "</pre>")
  EndIf
  
  WriteCGIString("</body></html>")