aboutsummaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
2017-12-04Add an rfc7231 test suite, fix an HTTP/2 bug with HEADLoïc Hoguin
In some cases there could be a body sent as a response to a HEAD request when using HTTP/2. This has been corrected.
2017-11-29Don't include a content-length in 204 responsesLoïc Hoguin
2017-11-29Fix a test descriptionLoïc Hoguin
2017-11-29Fix many rfc7230 tests that were echoing the URILoïc Hoguin
2017-11-29Fix a broken test case in the rfc7540 suiteLoïc Hoguin
2017-11-29Fix an intermittent test failure in the rfc7540 suiteLoïc Hoguin
2017-11-29Remove two warnings in test suitesLoïc Hoguin
2017-11-29Add nowarn_export_all to all test suitesLoïc Hoguin
2017-11-29Add many rfc7540 tests, improve detection of malformed requestsLoïc Hoguin
2017-11-27Add more flow control tests to rfc7540 and fix related issuesLoïc Hoguin
2017-11-27Add more rfc7540 tests along with their respective fixesLoïc Hoguin
2017-11-27Fix a few rfc7540 testsLoïc Hoguin
Cowboy takes a few shortcuts to avoid wasting resources when there is a protocol error. The RFC wants us to send a different error depending on the state of the stream at the time of the error, and for us to maintain the connection in cases where we would have to spend valuable resources to decode headers. In all these cases Cowboy will simply close the connection with an appropriate error.
2017-11-27Don't send the response immediately when using h2specLoïc Hoguin
In some cases we were sending a response faster than h2spec was sending us the test case data, resulting in the request being processed successfully instead of failing as expected.
2017-11-26Fix an rfc7230 testLoïc Hoguin
2017-11-24Add more tests to the rfc7230 suiteLoïc Hoguin
A few more bugs detected. I'm at the end of the list. I need to do a second reading, implement what I can, fix what I can and then the suite should be complete.
2017-11-24Add a few more rfc7230 testsLoïc Hoguin
A few seems to highlight more bugs. They have no fix yet.
2017-11-24Add more tests to the rfc7230 suiteLoïc Hoguin
Found more bugs! Unfortunately no fix for them in this commit.
2017-11-23Move the pipeline test to the rfc7230 suiteLoïc Hoguin
2017-11-22Add more rfc7230 tests and better handle bad chunk sizesLoïc Hoguin
Bad chunk sizes used to be accepted and could result in a badly parsed body or a timeout. They are now properly rejected. Chunk extensions now have a hard limit of 129 characters. I haven't heard of anyone using them and Cowboy does not provide an interface for them, but we can always increase or make configurable if it ever becomes necessary (but I honestly doubt it). Also a test from the old http suite could be removed. Yay!
2017-11-20Add more rfc7230 tests and improve transfer-encodingLoïc Hoguin
It's worth noting that transfer-encoding now takes precedence over content-length as recommended by the RFC, so that when both headers are sent we only care about transfer-encoding and explicitly remove content-length from the headers.
2017-11-20Add a test for early errors that occur on the request-lineLoï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-20Add more rfc7230 testsLoïc Hoguin
Also fixes the handling of the max_headers option for HTTP/1.1. It is now a strict limit and not dependent on whether data is already in the buffer.
2017-11-19Remove another test from the old http suiteLoïc Hoguin
2017-11-19Move tests from old http suite to rfc7230 suiteLoïc Hoguin
2017-11-19The static suite's large file is not created on WindowsLoïc Hoguin
2017-11-18Remove duplicate /echo/body_qs tests from the old suiteLoïc Hoguin
2017-11-17Remove duplicate static handler tests from the old suiteLoïc Hoguin
2017-11-17Disable the tracer suite when compiled nativelyLoïc Hoguin
2017-11-17Initialize trace patterns only onceLoïc Hoguin
They are global for the node for all future call trace flags, so it's not necessary to set them repeatedly with every request. Doing it once at startup also ensures we can't have race conditions when the user wants to change which trace patterns should be used (because requests are concurrent and patterns end up overwriting themselves repeatedly), and makes this changing of trace patterns much more straightforward: the user can just define the ones they want. The default function traces everything. In addition I have also added the tracer_flags option to make the trace flags configurable, excluding the tracer pid.
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-10Keep the state returned by the tracer callbackLoïc Hoguin
It was mistakenly discarded.
2017-11-03Add a terminate event to the tracer and more testsLoïc Hoguin
2017-11-01Fix stream_handler_SUITE test failuresLoïc Hoguin
2017-11-01Don't crash when cowboy_clock is not runningLoïc Hoguin
This can happen normally when Cowboy is restarted, for example. Instead of failing requests when that happens, we degrade gracefully and do a little more work to provide the current date header.
2017-11-01Add {switch_handler, Module} return value to cowboy_restLoïc Hoguin
Also {switch_handler, Module, Opts}. Allows switching to a different handler type. This is particularly useful for processing most of the request with cowboy_rest and then streaming the response body using cowboy_loop.
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-31Add some todosLoïc Hoguin
2017-10-31Fix a unused warningLoïc Hoguin
2017-10-31Fix broken tests in loop_handler_SUITELoïc Hoguin
2017-10-31Fix the static_handler test suiteLoïc Hoguin
Bad requests correctly return 400, not 500.
2017-10-31Add informational responses to metricsLoïc Hoguin
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-27Add cowboy_tracer_h stream handlerLoïc Hoguin
Another experimental stream handler. It enables tracing for the connection process and any children processes based on the matching of the request. It can be used to do ad-hoc tracing by sending a specific header, path, method or other. It is meant to be used both for tests and production. Some configuration scenarios are NOT safe for production, beware. It's important to understand that, at this time, tracing is enabled on the scale of the entire connection including any future request processes. Keep this in mind when trying to use it in production. The only way to stop tracing is by having the callback function exit (by calling exit/1 explicitly). This can be done after a certain number of events for example. Tracing can generate a lot of events, so it's a good idea to stop after a small number of events (between 1000 and 10000 should be good) and to avoid tracing the whole world. Documentation will follow at a later time.
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-23Fix a bug in HTTP/2 where connection gets closed prematurelyLoïc Hoguin
When the user code was sending a response fully without reading the request body, the connection could get closed when receiving DATA frames for that body. We now ask the client to stop sending data via a NO_ERROR RST_STREAM, and linger any stream that has been reset so that we can skip any pending frames from that stream. This fixes a number of intermittent failures in req_SUITE, which now passes reliably. In addition a small number of rfc7540_SUITE test cases have been corrected as they were incorrect.
2017-10-22Add a metrics test for switching to WebsocketLoïc Hoguin
2017-10-22Ensure stream terminate is called when switching protocolsLoïc Hoguin