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

2051 commits

Author SHA1 Message Date
Loïc Hoguin
e0b036fe68
Add tests for charsets_provided
Fix cases where the q-value is 0 and where a wildcard
was sent in the accept-charset header.

Also don't send a charset in the content-type of the
response if the media type is not text.

Thanks to Philip Witty for help figuring this out.
2018-11-02 13:54:19 +01:00
Loïc Hoguin
399b6a16b4
Better handle content negotiation when accept contains charsets
Thanks to Philip Witty for help figuring this out.
2018-11-02 13:49:54 +01:00
Loïc Hoguin
d4dff21055
Accept a broader media type as input in rest_pastebin example 2018-11-01 14:44:55 +01:00
Loïc Hoguin
b3bfcf068c
Add a cowboy_rest test for malformed if-*-match headers 2018-10-31 22:41:59 +01:00
Steve Domin
09bf1199aa
Add compress_threshold protocol option
Currently the compression threshold is set to 300 and hardcoded in the
codebase. There are cases where it make sense to allow this to be
configured, for instance when you want to enforce all responses to be
compressed regarldess of their size.
2018-10-31 17:05:11 +01:00
Loïc Hoguin
30e117a942
Make sure we don't send error_responses on the wrong stream 2018-10-31 15:35:49 +01:00
Grigory Starinkin
5ab5615ff0
Handle error_response command in cowboy_metrics_h 2018-10-31 15:13:23 +01:00
Loïc Hoguin
473e3fb82b
Improve a few types, including cowboy_req:req() 2018-10-31 14:11:45 +01:00
Loïc Hoguin
a8335c63df
Always dialyze tests and fix some cowboy_req specs 2018-10-31 10:50:57 +01:00
Loïc Hoguin
07078eb47b
Fix a test listener not being stopped 2018-10-31 09:25:19 +01:00
Loïc Hoguin
122faedc25
Initial support for the PROXY protocol header
Depend on Ranch master for now since it isn't in any release yet.
2018-10-30 23:30:54 +01:00
Loïc Hoguin
a002df4560
Fix the sys trap_exit tests
The processes go down slower now so that caused intermittent
issues.
2018-10-28 17:11:52 +01:00
Loïc Hoguin
e11279e0d2
Remove a useless todo 2018-10-28 13:12:17 +01:00
Loïc Hoguin
a764075b89
Rename a few functions and shuffle arguments 2018-10-28 11:47:49 +01:00
Loïc Hoguin
266178b6bc
Remove an unnecessary function 2018-10-28 11:42:18 +01:00
Loïc Hoguin
d4129e6305
Exit gracefully on parent exit/sys:terminate/2,3 2018-10-28 10:20:43 +01:00
Loïc Hoguin
21ff3ff256
Fix small issues introduced in the previous commit 2018-10-27 10:07:34 +02:00
Loïc Hoguin
f1018fd1c1
Use cow_http2_machine's timer handling 2018-10-27 00:16:13 +02:00
Loïc Hoguin
7d118b547f
Use cow_http2:parse_sequence/1 2018-10-26 18:51:49 +02:00
Loïc Hoguin
e1d970b5eb
Switch cowboy_http2 to the new cow_http2_machine
The new module is a merge of the Cowboy and Gun HTTP/2
state machines. Using a common code will help future
developments rather than duplicating the work.

A notable change is in how streams are terminated
when the handler stops before the body is sent. The
cowboy_stream:terminate function is now called only
after the body has been sent fully (or the stream
is reset in-between), not when the stop command is
returned. This will most likely have an impact on
metrics but will be closer to reality.

I had to comment a broken test in rfc7231_SUITE that
was cheating, cheating is no longer possible.

This depends on Cowlib master for the time being. A
new Cowlib version will be released once both Cowboy
and Gun are ported to use cow_http2_machine and I'm
satisfied with it.
2018-10-26 10:23:28 +02:00
Loïc Hoguin
3310849115
Simplify a case clause 2018-10-26 10:16:15 +02:00
Loïc Hoguin
497e9d459e
Add yet another RFC to the list 2018-10-26 10:15:41 +02:00
Loïc Hoguin
c998673eb0
Fix Cowboy version in the getting started chapter 2018-10-02 10:05:40 +02:00
Loïc Hoguin
d394eb7256
Fix ranch:start_tls when transport options are a map 2018-10-02 10:03:09 +02:00
Loïc Hoguin
a428b10abf
Shorten a command in the Makefile 2018-10-02 09:36:07 +02:00
Loïc Hoguin
3c8e6cf819
Use gun:info instead of hacks for test socket operations 2018-09-26 17:17:25 +02:00
getong
4493afbba0
Update Ranch to 1.6.2 2018-09-23 14:24:37 +02:00
Herman Singh
86cb105679
Rename handler modules to _h 2018-09-23 14:12:38 +02:00
Loïc Hoguin
8045f7a998
Add a spec to the list 2018-09-23 14:11:28 +02:00
Loïc Hoguin
bc43fca9e6
Fix stream_handler_SUITE test failures due to compression
We always compress when streaming the body back to the client
regardless of the size actually streamed.
2018-09-23 14:10:04 +02:00
Loïc Hoguin
f63609cb9c
Correct two tests that introspect the Gun state
It has changed in Gun 1.2.
2018-09-23 14:04:47 +02:00
Loïc Hoguin
a0f8d9b8b8
Rename the HTTP/2 Websocket test suite to rfc8441_SUITE 2018-09-21 16:12:19 +02:00
Loïc Hoguin
9901a3b568
Update Cowlib to 2.6.0 2018-09-21 15:12:58 +02:00
Loïc Hoguin
f810d8dd64
Add the {active, boolean()} Websocket command
This command is currently not documented. It allows disabling
the reading of incoming data from the socket, and can be used
as a poor man's flow control.
2018-09-21 15:01:57 +02:00
Loïc Hoguin
6e784f1a45
Remove an outdated note about cowboy_loop timeout 2018-09-20 15:57:15 +02:00
Loïc Hoguin
9f401f8899
Add RFC 8441 to the list 2018-09-19 09:14:58 +02:00
Loïc Hoguin
b56a5a1d60
Do not send a 101 after a final response in switch_protocol 2018-09-12 16:16:29 +02:00
Loïc Hoguin
26bc4afad4
Prepare the 2.5.0 release 2018-09-12 15:00:48 +02:00
Loïc Hoguin
3b173fd42c
Update erlang.mk 2018-09-12 15:00:48 +02:00
Loïc Hoguin
7a36bc7488
Update Cowlib to 2.5.1 2018-09-12 15:00:48 +02:00
Loïc Hoguin
8390b04f7a
Swap the ws and autobahn test groups to run autobahn last
If there's an error it makes sense to have feedback as early
as possible.
2018-09-11 14:45:41 +02:00
Loïc Hoguin
8404b1c908
Add a commands-based interface to Websocket handlers
This feature is currently experimental. It will become the
preferred way to use Websocket handlers once it becomes
documented.

A commands-based interface enables adding commands without
having to change the interface much. It mirrors the interface
of stream handlers or gen_statem. It will enable adding
commands that have been needed for some time but were not
implemented for fear of making the interface too complex.
2018-09-11 14:33:58 +02:00
Loïc Hoguin
4b385749f2
Add cowboy_req:read_and_match_urlencoded_body/2,3 2018-09-07 13:56:12 +02:00
Loïc Hoguin
dcc6f9326f
Fix some grammatical errors in the manual 2018-09-07 13:53:12 +02:00
Loïc Hoguin
a02d6590c4
Add upcoming Clear Site Data draft to the list 2018-09-07 13:51:25 +02:00
Loïc Hoguin
8d634d0ff4
See if recompiling ct_helper every time fixes ci builds 2018-08-13 22:23:05 +02:00
Loïc Hoguin
0a5fadc60b
Improve errors for when the ProvideCallback is missing 2018-08-13 17:23:48 +02:00
Loïc Hoguin
06a3a93de0
Update Ranch to 1.6.1 2018-08-13 15:07:59 +02:00
Loïc Hoguin
3bda790901
Clarify the DEP_PLUGINS line in the Getting Started 2018-08-13 11:14:53 +02:00
Loïc Hoguin
ef426e0ff4
Fix the infinity timeout tests
Make sure the test fails when the code is incorrect.
2018-08-13 11:10:49 +02:00