…a Content-Length header.
elli.hrl needs to be included by modules that modifies the req record.
- Replaced FileOpts in send_file/6 with Range, because the size option in FileOpts was actually redundant since the removal of prepare_send_file. - Made send_file more robust against errors. - Cleaned up some type specs. - Removed size related test and example code in elli_example_callback and elli_test.
…ected size. Probably a timing issue was causing gen_tcp:recv(Socket, 0) to return with a different buffer than expected in the eyes of the testcase.
… Elli will first receive and discard the client body before sending the response. If the request size is more than twice max_body_size, the connection is closed without receiving anything to avoid clients hogging bandwidth. Fixes #42.
Biggest change is moving all range and size parsing outside send_file into a new function prepare_send_file/5. This translates in a new send_file/5 whose signature and semantics are comparable to Elli's send_response.
…e, LastByte}. This makes working with ranges more consistent, since HTTP ranges also use the FirstByte, LastByte format. A side effect of this change is that ranges of length 0 are never possible anymore (but a size of 0 is still possible and results in a no-op)
…and gives possibility to send a sub part without setting a range.
…n order to catch invalid ranges
…ly seen as a suffix length.