Loïc Hoguin
9f9bd5ef56
Add more sys tests
2018-03-27 00:58:15 +02:00
Loïc Hoguin
5964273cc4
Fix the flushing of messages when switching to Websocket
...
We now flush messages that are specific to cowboy_http only.
Stream handlers should also flush their own specific messages
if necessary, although timeouts will be flushed regardless
of where they originate from.
Also renames the http_SUITE to old_http_SUITE to distinguish
new tests from old tests. Most old tests need to be removed
or converted eventually as they're legacy tests from Cowboy 1.0.
2018-03-26 18:53:07 +02:00
Loïc Hoguin
4d5174632c
Add initial support for system messages in cowboy_loop
2018-03-23 18:33:16 +01:00
Loïc Hoguin
21c9c66971
Merge the two separate receive loops in cowboy_websocket
...
Also rename a bunch of functions to make the code easier to read.
2018-03-23 16:32:53 +01:00
Loïc Hoguin
31092b546c
Add RFC 8336 to the list
2018-03-23 16:22:04 +01:00
Loïc Hoguin
ac07dbeb04
Update rebar.config
2018-03-22 15:32:42 +01:00
Loïc Hoguin
6945882cd3
Fix a Dialyzer warning
2018-03-14 17:43:13 +01:00
Bartek Walkowicz
2131709328
Add case for handling infinity for idle/request_timeout
...
Currently cowboy assumes that idle_timeout or request_timeout is
a number and always starts timers. Similar situation takes place
in case of preface_timeout for http2. This commit adds case for
handling infinity as a timeout, allowing to not start mentioned
timers.
2018-03-14 17:15:06 +01:00
Loïc Hoguin
f9092126fa
Handle system messages in cowboy_websocket
2018-03-13 11:19:13 +01:00
Loïc Hoguin
b9c8d86502
Handle supervisor calls properly everywhere
2018-03-13 10:40:14 +01:00
Loïc Hoguin
a89732e8e0
Initial work on the sys_SUITE
...
There's already tests failing and quite some refactoring to be
done to make some things easier to test or fix issues.
2018-03-12 16:52:02 +01:00
Loïc Hoguin
e4f1c332a3
Add a test suite for RFC7538; update Cowlib to 2.2.0
...
This adds the 308 status code and fixes a few small
parsing bugs.
2018-03-05 16:48:56 +01:00
Loïc Hoguin
b47b511cbe
Enable ci.erlang.mk only when CI_ERLANG_MK=1 is set
...
This will avoid issues with other people's build systems.
2018-02-28 17:44:23 +01:00
Loïc Hoguin
19054e40e0
Fix crash in cowboy_http2 when content-length is invalid
2018-02-28 16:18:29 +01:00
Loïc Hoguin
e23e12287a
Add a new relevant RFC
2018-02-15 23:33:04 +01:00
Loïc Hoguin
cbd64e617a
Add link to the PROXY protocol to the specs
...
It's very relevant even though I will probably not implement it.
2018-02-09 18:15:37 +01:00
Loïc Hoguin
50fd64ec34
Add an example with a Websocket close frame
...
Thanks benbro!
2018-01-29 13:03:42 +01:00
Loïc Hoguin
d27a373bc3
Fix a small issue in the cowboy_req:parse_cookies manual
...
Thanks benbro!
2018-01-29 12:57:33 +01:00
Loïc Hoguin
8d49ae3dda
Update Cowboy to 2.2.2
2018-01-24 11:50:07 +01:00
Loïc Hoguin
819a47a220
Fix sending HTTP/2 bodies as iolists out of order
2018-01-24 11:44:03 +01:00
Loïc Hoguin
d329ca4b60
Update Cowboy to 2.2.1
2018-01-23 17:01:17 +01:00
Loïc Hoguin
e09ae60d5b
Fix an unused variable warning
2018-01-23 16:29:25 +01:00
Loïc Hoguin
482de55a96
Fix a miscount of output flow control window for HTTP/2
...
The miscount occurred because of a faulty iolist split function.
The bug should now be corrected, a PropEr test has been added
and a regression test has also been added.
2018-01-23 16:14:18 +01:00
Loïc Hoguin
3a7b411143
Don't crash in delete_resp_header if no resp headers are set
2018-01-22 14:00:05 +01:00
Paul Fisher
82cd22a88b
Allow colon within path segments
...
Allow `cowboy_router:compile` to handle colon characters within
path segments, rather than exiting with `badarg`. This is allowed
via RFC 7230 2.7 -> [RFC 3986 3.3](https://tools.ietf.org/html/rfc3986#section-3.3 ):
```
segment = *pchar
segment-nz = 1*pchar
segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
; non-zero-length segment without any colon ":"
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
```
2018-01-16 11:24:49 +01:00
Loïc Hoguin
7cb3a9dbda
Add RFC 8297 to the list
2018-01-02 23:09:09 +01:00
Loïc Hoguin
572d38082f
Document the missing inform stream handler command
2017-12-13 12:43:28 +01:00
Loïc Hoguin
34473bc247
Fix Dialyzer warnings
2017-12-13 12:40:00 +01:00
Loïc Hoguin
576e2d2111
Don't badmatch on HTTP/2 preface's Transport:send
...
Send errors produce annoying logs and we notice the connection
is gone later on anyway.
2017-12-12 16:57:05 +01:00
Loïc Hoguin
eafca21198
Fix HTTP/1.1 pipelining
...
Cases where a request body was involved could sometimes
fail depending on timing. Also fix all of the old
http_SUITE tests.
2017-12-12 11:37:48 +01:00
Loïc Hoguin
01e13c0846
Fix how we require HTTP/1.0 from Gun in rfc7231_SUITE
2017-12-11 17:43:02 +01:00
Loïc Hoguin
388a68fc2e
Update Cowboy to 2.2.0
2017-12-11 14:17:38 +01:00
Loïc Hoguin
364a3527d4
Document trailers in the guide
2017-12-11 12:43:14 +01:00
Loïc Hoguin
6d65cd0d38
Small documentation tweaks
2017-12-11 11:56:14 +01:00
Loïc Hoguin
4c22bdbcb7
Document 2.2 changes and the new stream_trailers function
2017-12-11 11:00:47 +01:00
Loïc Hoguin
17719a136d
Add the few remaining tests to the rfc7231 test suite
2017-12-08 20:38:31 +01:00
Loïc Hoguin
b000d53855
Add more rfc7231 tests and a new max_skip_body_length option
...
The option controls how much body we accept to skip for HTTP/1.1
connections when the user code did not consume the body fully.
It defaults to 1MB.
2017-12-07 22:33:52 +01:00
Loïc Hoguin
c2b813684e
Send a 426 when Websocket is required and client didn't upgrade
2017-12-06 17:31:32 +01:00
Loïc Hoguin
5269bf580b
Fix 408 not sending connection: close for HTTP/1.1
...
Also make sure the header is sent for all types of early_error
that result in the closing of the connection.
2017-12-06 16:30:30 +01:00
Loïc Hoguin
1f4c1e2c67
Add more rfc7231 tests
2017-12-06 14:38:27 +01:00
Loïc Hoguin
bc39b433bb
Properly handle OPTIONS * requests
...
Support for these was broken during the development
of Cowboy 2.0. It is now fixed and better handled
than it ever was.
2017-12-06 14:05:30 +01:00
Loïc Hoguin
2eb3e3f994
Also disable the TRACE method entirely
2017-12-06 10:54:23 +01:00
Loïc Hoguin
dd002b8141
Disable the CONNECT method completely
...
It's safer than allow it with the wrong behavior.
2017-12-06 00:30:59 +01:00
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