aboutsummaryrefslogtreecommitdiffstats
path: root/test/req_SUITE.erl
AgeCommit message (Collapse)Author
2018-11-09Add sendfile support to cowboy_req:stream_bodyLoïc Hoguin
It is now possible to stream one or more sendfile tuples. A simple example of what can now be done would be for example to build a tar file on the fly using the sendfile syscall for sending the files, or to support Range requests with more than one range with the sendfile syscall. When using cowboy_compress_h unfortunately we have to read the file in order to send it. More options will be added at a later time to make sure users don't read too much into memory. This is a new feature however so existing code is not affected. Also rework cowboy_http's data sending to be flatter.
2018-09-07Add cowboy_req:read_and_match_urlencoded_body/2,3Loïc Hoguin
2018-06-27Add test cases for cowboy_req:stream_eventsLoïc Hoguin
2018-06-25Add streaming without chunking for HTTP/1.1Eric Meadows-Jönsson
If content-length is set in the response headers we can skip chunked transfer-encoding.
2018-05-17Remove/convert tests about request body from old_http_SUITELoïc Hoguin
2018-05-16Increase a timeout to make some slower tests passLoïc Hoguin
2018-05-16Use default port when not given in :authorityLoïc Hoguin
2017-11-29Add nowarn_export_all to all test suitesLoïc Hoguin
2017-11-20Queue HTTP/2 trailers when there's still data in the bufferLoïc Hoguin
2017-11-20Improve trailers test when no te header is sentLoïc Hoguin
2017-11-19Remove another test from the old http suiteLoïc Hoguin
2017-11-15Add preliminary support for trailers in responsesLoïc Hoguin
This depends on changes in Cowlib that are only available on master.
2017-11-01Fix two edge cases for cowboy_req:stream_bodyLoïc Hoguin
Sending data of size 0 with the fin flag set resulted in nothing being sent to the client and still considering the response to be finished for HTTP/1.1. For both HTTP/1.1 and HTTP/2, the final chunk of body that is sent automatically by Cowboy at the end of a response that the user did not properly terminate was not passing through stream handlers. This resulted in issues like compression being incorrect. Some tests still fail under 20.1.3. They are due to recent zlib changes and should be fixed in a future patch release. Unfortunately it does not seem to be any 20.1 version that is safe to use for Cowboy, although some will work better than others.
2017-10-30Handle expect: 100-continue request headersLoïc Hoguin
The 100 continue response will only be sent if the client has not sent the body yet (at all), if the connection is HTTP/1.1 or above and if the user has not sent it yet. The 100 continue response is sent when the user calls read_body and it is cowboy_stream_h's responsibility to send it. This means projects that don't use the cowboy_stream_h stream handler will need to handle the expect header themselves (but that's okay because they might have different considerations than normal Cowboy).
2017-10-29Add cowboy_req:inform/2,3Loïc Hoguin
User code can now send as many 1xx responses as necessary.
2017-10-25Introduce cowboy_req:sock/1 and cowboy_req:cert/1Loïc Hoguin
To obtain the local socket ip/port and the client TLS certificate, respectively.
2017-10-02Fix infinite loop on incomplete multipart bodyJeffrey Griffin
I have amended a lot of changes from the original commit to make it behave as expected, including returning a 400 error. LH
2017-09-27Fix error response when constraint validation failsLoïc Hoguin
2017-09-14Improve how we detect request errorsLoïc Hoguin
When the request process exits with a {request_error, Reason, Human} exit reason, Cowboy will return a 400 status code instead of 500. Cowboy may also return a more specific status code depending on the error. Currently it may also return 408 or 413. This should prove to be more solid that looking inside the stack trace.
2017-09-05Add tests for direct Req accessLoïc Hoguin
2017-09-04Accept sendfile tuple with 0 length in cowboy_reqLoïc Hoguin
This will result in no data being sent. It's simply easier to do this than to have to handle 0 size cases in user code.
2017-06-09Make cowboy_req:read_part return multipart headers as mapLoïc Hoguin
2017-05-19Preliminary h2 flow control supportLoïc Hoguin
Existing tests pass. A number of things remain to be done. Has only been tested with Gun so far. Feedback welcome!
2017-02-19Change the type of bindings from a list to a mapLoïc Hoguin
Maps make more sense because the keys are unique.
2017-02-05Remove outdated todo comments from req_SUITELoïc Hoguin
2017-01-22Add experimental cowboy_compress_h stream handlerLoïc Hoguin
Currently marked as experimental because it can't be tweaked (just enabled/disabled) and because it is not documented yet.
2017-01-04Make the new cowboy_req tests more realistic2.0.0-pre.5Loïc Hoguin
2017-01-04Add functions for getting and setting response headersJohan Lövdahl
2017-01-02Welcome to 2017Loïc Hoguin
2017-01-02Add a few more test cases for cowboy_req:match_qsLoïc Hoguin
2016-08-10Add tests for responses and request body readingLoïc Hoguin
This is a large commit. The cowboy_req interface has largely changed, and will change a little more. It's possible that some examples or tests have not been converted to the new interface yet. The documentation has not yet been updated. All of this will be fixed in smaller subsequent commits. Gotta start somewhere...
2016-06-22Add tests for cowboy_req: match_cookies and match_qsLoïc Hoguin
2016-06-21Add cowboy_req:uri/1,2Loïc Hoguin
Along with more cowboy_req tests. This commit also removes cowboy_req:url/1 and cowboy_req:host_url/1 in favor of the much more powerful new set of functions.
2016-06-20Add initial req suiteLoïc Hoguin