gabriel / as3httpclient

HTTP Client for AS3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

POST fails with ByteArray body with position != 0

petergeneric opened this issue · comments

When making a POST request, if the request.body is a ByteArray and the array is not at position 0 the request fails.

This looks to be because the Content-Length header is set based on the .length of the body, however during transport it expects there to be .length bytes of data after the current position. It would at least be worth a warning in the documentation for HttpRequest (or possibly changing the code to generate Content-Length using .bytesAvailable instead of .length?)