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

1583 commits

Author SHA1 Message Date
Loïc Hoguin
d3f15cfd8b
Make a few link use https 2017-10-03 18:05:23 +02:00
Loïc Hoguin
716a052b15
Update version, CI and Cowlib dependency version
Hello 2.0.0!
2017-10-03 17:10:16 +02:00
Loïc Hoguin
6fc05a6d64
Make sure a path parsing error in the router gives a 400 2017-10-03 00:30:15 +02:00
Loïc Hoguin
b2bd9ccfb5
Document cow_ws:frame in Cowboy for now 2017-10-02 18:06:06 +02:00
Loïc Hoguin
9317751cb3
Fix cowboy:set_env when the env value is missing 2017-10-02 16:19:13 +02:00
Jeffrey Griffin
6460e9d2d2
Fix infinite loop on incomplete multipart body
I have amended a lot of changes from the original commit
to make it behave as expected, including returning a 400
error. LH
2017-10-02 13:28:43 +02:00
Loïc Hoguin
292e732abf
Fix the documentation for the command flow 2017-10-02 10:46:45 +02:00
Loïc Hoguin
bec019dce5
Clarify a multipart example 2017-09-27 18:54:51 +02:00
Loïc Hoguin
754d125f35
Cowboy 2.0.0-rc.4 2017-09-27 18:30:13 +02:00
Loïc Hoguin
fda2d150db
Fix error response when constraint validation fails 2017-09-27 16:20:38 +02:00
Loïc Hoguin
5fe46ebe64
Add OTP-20.1 to CI 2017-09-27 14:22:44 +02:00
Loïc Hoguin
11ae407eed
Ensure the behavior on stream handler crash is consistent
Also corrects the lack of error response when HTTP/1.1 is used.
2017-09-27 14:17:27 +02:00
Loïc Hoguin
d47e22edaa
Cleanup various comments 2017-09-25 13:52:58 +02:00
Loïc Hoguin
ea80e7a309
Avoid some crashes when HTTP/2 streams flush their response 2017-09-25 12:55:30 +02:00
Loïc Hoguin
c09b10190b
Move body length count to cowboy_stream_h instead of protocols
The documentation was correct, the code was not.

This should make it easier to implement new protocols. Note that
for HTTP/2 we will need to add some form of counting later on to
check for malformed requests, but we can do simpler and just
reduce from the expected length and then check if that's 0 when
IsFin=fin.
2017-09-25 12:48:47 +02:00
Loïc Hoguin
a6126306a2
Centralize stream handler error reporting in cowboy_stream 2017-09-21 12:53:21 +02:00
Loïc Hoguin
17400f73b4
Cowboy 2.0.0-rc.3 2017-09-15 12:55:05 +02:00
Loïc Hoguin
a2832d5f4a
Add OTP 20.0.5 to CI 2017-09-15 12:52:16 +02:00
Loïc Hoguin
6b2354a3bc
Add two new RFCs, remove one obsolete 2017-09-15 09:42:49 +02:00
Loïc Hoguin
1cc877b649
Fix propagating the stacktrace on errors for OTP 19 2017-09-14 18:23:55 +02:00
Loïc Hoguin
5027d1335d
Rework the proc_lib_hack
It is completely removed for connection processes, because
assuming Cowboy is written properly this should bring us
nothing anymore in 2.0.

It is reworked for request processes, there we want to
always propagate the stacktrace (including for exits)
because we will print a report to help with debugging
and proc_lib doesn't propagate it for exits.

At the same time the initial callback for connection
and request processes has been changed to connection_process
and request_process, which should help with identifying
processes when inspecting.
2017-09-14 15:34:37 +02:00
Loïc Hoguin
3cbf885961
Improve how we detect request errors
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-14 13:42:17 +02:00
Loïc Hoguin
15ceaf1edf
Update naming in REST flowcharts 2017-09-05 17:19:15 +02:00
Loïc Hoguin
9f5a1803da
Add tests for direct Req access 2017-09-05 15:28:11 +02:00
Loïc Hoguin
2376983295
Remove transfer-encoding parsing from cowboy_req
The header never reaches this point.
2017-09-05 13:25:06 +02:00
Loïc Hoguin
d1c210b105
Remove an unused variable 2017-09-05 13:24:46 +02:00
Loïc Hoguin
4fd6e2f7cd
Accept sendfile tuple with 0 length in cowboy_req
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-09-04 20:48:07 +02:00
Loïc Hoguin
0995fc99e0
Add a static handler test with an empty file 2017-09-04 18:00:56 +02:00
Loïc Hoguin
0828e0b9ce
Alphabetical order some tests 2017-09-04 15:48:46 +02:00
Loïc Hoguin
58e9e76814
Fix more documentation todos
I have decided not to include a manual page for
cowboy_stream_h at this point because it clashes
with the cowboy_stream manual page. This decision
will be revisited in the future.
2017-09-04 14:33:44 +02:00
Loïc Hoguin
47aa0097ed
Add OTP 20.0.4 to CI 2017-08-29 11:29:30 +02:00
Loïc Hoguin
3d8339267b
Cowboy 2.0.0-rc.2 2017-08-23 15:04:57 +02:00
Loïc Hoguin
9a1810bf13
Tentative fix for out of order queued data 2017-08-21 16:55:30 +02:00
Loïc Hoguin
daef32d907
Properly clean up timers when terminating 2017-08-21 14:40:01 +02:00
Loïc Hoguin
a2facaf2da
Add tests for the streams shutdown mechanism 2017-08-14 17:17:44 +02:00
Loïc Hoguin
58b70a594b
Remove broken links from examples README 2017-08-09 09:47:56 +02:00
Loïc Hoguin
c0ec1ad4a9
Add missing cowboy_children module
My bad! Still new at this.
2017-08-08 21:39:23 +02:00
Loïc Hoguin
b5defc6e0d
Add OTP-20.0.2 to CI 2017-08-08 17:11:45 +02:00
Loïc Hoguin
45ddcd8c67
Implement the shutdown timeout for request processes
This should work very similar to normal supervisors,
in particular during the shutdown sequence when the
connection process goes down or switches to Websocket.

Processes that need to enforce the shutdown timeout
will be required to trap exits, just like in a supervisor.
In a vanilla Cowboy, this only matters at connection
shutdown, as Cowboy will otherwise wait for the request
process to be down before stopping the stream.

Tests are currently missing.
2017-08-08 16:59:33 +02:00
Loïc Hoguin
4fa7aeb0fd
Fix HTTP/2 server push
Cowboy was encoding the headers then decoding them when initializing
the request. The problem is that the encoding and decoding contexts
are not the same. Now, Cowboy will directly use the headers it
received in the push command for the new request. This is also
more efficient.

I am surprised it worked at all considering the issue.
2017-07-26 17:36:41 +02:00
Loïc Hoguin
238ac3afc6
Update version to 2.0.0-rc.1 2017-07-24 11:57:47 +02:00
Loïc Hoguin
9860eb88c1
Small tweak to the guide 2017-07-24 11:55:12 +02:00
Loïc Hoguin
95da4f8f18
Write an initial draft of the streams chapter 2017-07-23 18:54:05 +02:00
Loïc Hoguin
53a24b990e
Remove yet another outdated todo 2017-07-23 18:53:48 +02:00
Loïc Hoguin
d4fb6571b3
Update the constraints chapter 2017-07-23 15:30:32 +02:00
Loïc Hoguin
0556fb027c
Update the flowchart chapter 2017-07-23 09:48:25 +02:00
Loïc Hoguin
5bb2003afc
Add a related RFC for Websocket
This is important because it clarifies that sec-websocket-protocol
is case sensitive when matching. Only the registry is case
insensitive.
2017-07-20 18:30:17 +02:00
Loïc Hoguin
3099fc1d9f
Remove cowboy_sub_protocol from the documentation
This will be reintroduced in a future release once the
interface stabilizes. For the time being it will be an
internal module only.
2017-07-20 18:28:06 +02:00
Loïc Hoguin
e4cab480dc
Remove the old architecture chapter 2017-07-19 23:03:14 +02:00
Loïc Hoguin
a832369a02
Remove the guide chapter about broken clients
None of these workarounds currently exist in Cowboy 2.0.
We can resurrect the chapter later if it's still necessary,
once we've added the workarounds back in some other form.
2017-07-19 22:15:59 +02:00