0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00
Commit graph

1866 commits

Author SHA1 Message Date
Loïc Hoguin
10dc2c2ef0
Add an rfc7231 test suite, fix an HTTP/2 bug with HEAD
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-12-04 18:21:10 +01:00
Loïc Hoguin
2185198dee
Fix HTTP/2 push 2017-11-30 15:01:01 +01:00
Loïc Hoguin
a66eb5cd6e
Don't send chunked bodies when the method is HEAD 2017-11-29 22:09:33 +01:00
Loïc Hoguin
b0519af42a
Don't include a content-length in 204 responses 2017-11-29 21:38:10 +01:00
Loïc Hoguin
8d9404e9b6
Reject absolute URIs with no authority components 2017-11-29 18:33:50 +01:00
Loïc Hoguin
d50bab8e78
Reject absolute URIs with userinfo components in HTTP/1.1 2017-11-29 18:10:11 +01:00
Loïc Hoguin
14b4afa669
Fix a test description 2017-11-29 18:07:38 +01:00
Loïc Hoguin
37d069cd51
Fix many rfc7230 tests that were echoing the URI 2017-11-29 18:07:23 +01:00
Loïc Hoguin
aea172857f
Reject whitespace before/after HTTP/1.1 header names properly 2017-11-29 18:01:16 +01:00
Loïc Hoguin
bec9a43d50
Fix a broken test case in the rfc7540 suite 2017-11-29 17:52:09 +01:00
Loïc Hoguin
0246d9a4e6
Don't send a GOAWAY frame on close when the h2 preface is invalid 2017-11-29 17:49:42 +01:00
Loïc Hoguin
bd6c32d3b7
Fix an intermittent test failure in the rfc7540 suite 2017-11-29 17:17:22 +01:00
Loïc Hoguin
1066a8d376
Remove two warnings in test suites 2017-11-29 17:03:16 +01:00
Loïc Hoguin
cf3ab5832a
Add nowarn_export_all to all test suites 2017-11-29 16:57:10 +01:00
Loïc Hoguin
d33a0df3fe
Ignore stray HTTP/2 stream messages that we expect 2017-11-29 16:41:40 +01:00
Loïc Hoguin
73126e7693
Add many rfc7540 tests, improve detection of malformed requests 2017-11-29 14:54:47 +01:00
Loïc Hoguin
4cdd1aa70e
Add more flow control tests to rfc7540 and fix related issues 2017-11-27 22:49:50 +01:00
Loïc Hoguin
7f80ff28a5
Add more rfc7540 tests along with their respective fixes 2017-11-27 19:00:35 +01:00
Loïc Hoguin
bc82679330
Fix a few rfc7540 tests
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-27 13:42:04 +01:00
Loïc Hoguin
843b104fcb
Don't send the response immediately when using h2spec
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-27 13:23:31 +01:00
Loïc Hoguin
e71733232e
Fix an rfc7230 test 2017-11-26 10:12:25 +01:00
Loïc Hoguin
7cd59f4367
Add more tests to the rfc7230 suite
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-24 22:40:15 +01:00
Loïc Hoguin
aa453d4825
Add a few more rfc7230 tests
A few seems to highlight more bugs. They have no fix yet.
2017-11-24 19:08:49 +01:00
Loïc Hoguin
ce32e1985a
Add more tests to the rfc7230 suite
Found more bugs! Unfortunately no fix for them in this commit.
2017-11-24 00:16:19 +01:00
Loïc Hoguin
14173d5929
Move the pipeline test to the rfc7230 suite 2017-11-23 18:50:07 +01:00
Loïc Hoguin
c4e43ec26a
Add more rfc7230 tests and better handle bad chunk sizes
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-22 23:10:00 +01:00
Loïc Hoguin
1af508c4cd
Add more rfc7230 tests and improve transfer-encoding
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-20 21:12:05 +01:00
Loïc Hoguin
3da9a6eef9
Add a test for early errors that occur on the request-line 2017-11-20 16:26:37 +01:00
Loïc Hoguin
92672b49af
Queue HTTP/2 trailers when there's still data in the buffer 2017-11-20 15:46:23 +01:00
Loïc Hoguin
9969684035
Improve trailers test when no te header is sent 2017-11-20 12:17:44 +01:00
Loïc Hoguin
6c765101b1
Fix compression when trailers are sent 2017-11-20 12:13:57 +01:00
Loïc Hoguin
ecb2a735ef
Remove a useless todo 2017-11-20 11:28:22 +01:00
Loïc Hoguin
62bf505d33
Add more rfc7230 tests
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-20 00:23:27 +01:00
Loïc Hoguin
d7761b5259
Remove another test from the old http suite 2017-11-19 22:17:57 +01:00
Loïc Hoguin
f6539a9a68
Move tests from old http suite to rfc7230 suite 2017-11-19 22:04:48 +01:00
Loïc Hoguin
8be803cb07
The static suite's large file is not created on Windows 2017-11-19 16:13:48 +01:00
Loïc Hoguin
344cec95b4
Add AUTO_CI_WINDOWS variable 2017-11-19 13:25:54 +01:00
Loïc Hoguin
185d928e1a
Remove duplicate /echo/body_qs tests from the old suite 2017-11-18 00:19:01 +01:00
Loïc Hoguin
bfe7f82812
Remove duplicate static handler tests from the old suite 2017-11-17 23:57:32 +01:00
Loïc Hoguin
435c541810
Move ci.erlang.mk to TEST_DEPS 2017-11-17 22:57:44 +01:00
Loïc Hoguin
aedd274e26
Disable the tracer suite when compiled natively 2017-11-17 22:55:56 +01:00
Loïc Hoguin
ce5ab4b49a
Initialize trace patterns only once
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-17 13:23:38 +01:00
Loïc Hoguin
52d869128b
Tweak the Makefile 2017-11-17 13:18:13 +01:00
Loïc Hoguin
39baed6c80
Add preliminary support for trailers in responses
This depends on changes in Cowlib that are only available on
master.
2017-11-15 14:58:49 +01:00
Loïc Hoguin
a1ad482eb4
Don't supervise the tracer process
If we do then we end up killing the tracer after the stream
terminates and this is not what we want. This prevents us from
getting useful information from requests that are still ongoing
(when they run concurrently) and completely prevents us from
tracing Websocket handlers.

I'm not the biggest fan of having unsupervised modules but if
this is properly documented there should be no problem.
2017-11-13 20:45:08 +01:00
Loïc Hoguin
6a8f9ebbb2
Fix packet being dropped when using switch_protocol
This only happens if the switch takes too long, and should not
happen unless a spawned process refuses to shut down immediately.
2017-11-13 18:03:25 +01:00
Loïc Hoguin
56dc5673d0
Use my new ci.erlang.mk plugin
Instead of tracking Erlang/OTP versions manually in each project,
I can just say OTP-19+ and let the plugin fill in the most recent
patch releases for each version. In addition I will configure the
CI commands to cleanup unneeded versions automatically.
2017-11-12 22:31:02 +01:00
Loïc Hoguin
6cc162583d
Keep the state returned by the tracer callback
It was mistakenly discarded.
2017-11-10 14:59:11 +00:00
Loïc Hoguin
32d9d494c7
Add a changelog for cowboy_rest 2017-11-09 13:23:31 +00:00
Loïc Hoguin
f200a6febd
Fix the introduction version for the new 2.1 functions 2017-11-09 13:21:29 +00:00