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

2155 commits

Author SHA1 Message Date
Loïc Hoguin
e4762a6be3
Update CONTRIBUTING.asciidoc 2024-11-15 11:16:45 +01:00
Loïc Hoguin
c91f4d99ce
Add Discord server to README 2024-11-15 11:07:41 +01:00
Loïc Hoguin
7e160b4947
CI: Remove unneeded env 2024-11-08 12:54:26 +01:00
Loïc Hoguin
b7362f3263
CI: Add concurrency rules 2024-11-08 12:13:28 +01:00
Loïc Hoguin
5c74869abc
CI: Simplify testing for examples
Since we only test them on Ubuntu we can use setup-beam
to install Erlang/OTP and avoid waiting for all other
checks to complete.

Also make the "delete master" job conditional rather
than only its step.
2024-11-08 12:13:23 +01:00
Loïc Hoguin
b1cb95fe74
CI: Fix master build deletion
Some things likely changed and made it not work anymore.

Also seems that the macOS runner is now ARM64.
2024-11-07 14:45:42 +01:00
Loïc Hoguin
9f0f2a89d7
Fix markdown example for OTP-27 2024-11-07 13:28:26 +01:00
Loïc Hoguin
e761e3ba7b
CI: Upload logs in examples job too 2024-11-06 20:26:21 +01:00
Loïc Hoguin
99e2cf43c2
Update Erlang.mk 2024-11-06 16:33:39 +01:00
Loïc Hoguin
b77dd29133
Add VU#421644 to the HTTP/2 CONTINUATION Flood test 2024-04-05 22:08:59 +02:00
Loïc Hoguin
8cb9d242b0
Initial HTTP/3 implementation
This includes Websocket over HTTP/3.

Since quicer, which provides the QUIC implementation,
is a NIF, Cowboy cannot depend directly on it. In order
to enable QUIC and HTTP/3, users have to set the
COWBOY_QUICER environment variable:

  export COWBOY_QUICER=1

In order to run the test suites, the same must be done
for Gun:

  export GUN_QUICER=1

HTTP/3 support is currently not available on Windows
due to compilation issues of quicer which have yet to
be looked at or resolved.

HTTP/3 support is also unavailable on the upcoming
OTP-27 due to compilation errors in quicer dependencies.
Once resolved HTTP/3 should work on OTP-27.

Because of how QUIC currently works, it's possible
that streams that get reset after sending a response
do not receive that response. The test suite was
modified to accomodate for that. A future extension
to QUIC will allow us to gracefully reset streams.

This also updates Erlang.mk.
2024-03-26 15:53:48 +01:00
Loïc Hoguin
3ea8395eb8
Cowboy 2.12.0 2024-03-14 15:06:07 +01:00
Loïc Hoguin
f7956a0f44
Update erlang.mk 2024-03-14 12:59:05 +01:00
Loïc Hoguin
cf71c742d6
Add max_fragmented_header_block_size HTTP/2 option 2024-03-14 12:56:33 +01:00
Loïc Hoguin
81f3a21474
Make sure we can cancel ct-examples in CI 2024-01-29 11:38:35 +01:00
Loïc Hoguin
1c464083fa
Update ssl_hello_world example certificate 2024-01-26 15:38:40 +01:00
Loïc Hoguin
a0314a6dff
Don't use specific actions versions and update cache to v4 2024-01-26 13:43:11 +01:00
Loïc Hoguin
7d3aa6c9dd
Run make ct-examples at the end of normal CI 2024-01-26 12:34:37 +01:00
Loïc Hoguin
b36f064a91
Refresh copyright lines 2024-01-25 11:22:54 +01:00
Loïc Hoguin
8f9051519e
Cowboy 2.11 2024-01-23 15:29:41 +01:00
Loïc Hoguin
f060e6c4ff
Document reset_idle_timeout_on_send option 2024-01-23 14:48:15 +01:00
geeksilva97
08c2be058a
Fix match_qs with constraints when key is not present
Original fix by Ali Farhadi <a.farhadi@gmail.com>.
2024-01-23 14:11:29 +01:00
Loïc Hoguin
3e145af9b9
Getting started must include relx in deps 2024-01-23 14:08:06 +01:00
Loïc Hoguin
427a276ef2
Update the guide with range requests support
Also update the list of headers cowboy_rest might set
and tweak a small number of other items.
2024-01-23 13:15:55 +01:00
Loïc Hoguin
4ffcbfbf43
Document range requests 2024-01-22 11:41:46 +01:00
Loïc Hoguin
e8b4715a9f
Reduce sleep in chunked_one_byte_at_a_time
To avoid having the connection get closed due to us taking
too long on unreliable environments like GitHub Actions.
2024-01-18 15:19:23 +01:00
Loïc Hoguin
992ee6241d
Retry the read_urlencoded_body_too_large if timeout triggers
This is caused by the timeout being 1s after the period.
When the CI environment is overloaded, sometimes the
timeout will trigger. We retry, knowing that the
timetrap will catch us if we retry too much.
2024-01-18 12:15:11 +01:00
Loïc Hoguin
ecf3d43613
Improve reliability of a few tests
GitHub Actions runners are not as good as self-hosted BuildKite
so some adjustments need to be made to timeouts and such.
2024-01-17 20:56:46 +01:00
Loïc Hoguin
cff9938a66
Show links in README in make prepare_tag 2024-01-17 12:55:52 +01:00
Loïc Hoguin
5fe1be7007
Add missing manual pages for cowboy_stream functions 2024-01-17 12:52:45 +01:00
Loïc Hoguin
defce46fdf
REST: Allow generate_etag to return undefined
This allows conditionally generating an etag.
2024-01-16 16:28:52 +01:00
Loïc Hoguin
ec12c2f051
Recommend increasing max_frame_size_received HTTP/2 option 2024-01-16 13:11:38 +01:00
Loïc Hoguin
08a8d7b9e9
Confirm Websocket pong frames are received by handlers 2024-01-16 12:20:38 +01:00
Loïc Hoguin
920adb9b82
Fix an intermittent test failure 2024-01-16 11:21:30 +01:00
geeksilva97
308045fd67
Reject responses with explicit set-cookie header
LH: The tests received a lot of fixes and tweaking.
    I also reworded the error message to be more concise.
2024-01-15 17:43:14 +01:00
Loïc Hoguin
1a175e7b56
Fix wrong HTTP/1 timeout being used in some cases
Added many tests to ensure the right timeout is picked in
the appropriate situation. Should there be any issues
remaining we can add more tests.
2024-01-15 15:18:40 +01:00
Loïc Hoguin
906a7ffc3c
Better error message when trying to reply twice
Also crash if trying to push after a reply was sent.
2024-01-09 13:06:11 +01:00
Loïc Hoguin
f0101ffe41
Shorten the 204/304 error message 2024-01-09 11:01:39 +01:00
Loïc Hoguin
a40bab8fb3
Improve the error when trying to send a 204/304 with a body 2024-01-09 10:59:40 +01:00
Loïc Hoguin
e4a78aaeb1
Document body reading in auto mode
It is now tested both via cowboy_req:read_body and
via cowboy_req:cast.

Removes a bad example from the guide of body reading
with period of infinity, which does not work.
2024-01-08 15:13:18 +01:00
Loïc Hoguin
c1490d7d55
Ensure HTTP/1.1 Websocket resets the trap_exit flag
While we are identified as a supervisor in the tree,
we no longer manage children processes at that point,
so do not need to trap exit signals. Users can still
enable trap_exit if they prefer to.
2024-01-08 11:47:59 +01:00
Loïc Hoguin
9784179498
Always add vary: accept-encoding in cowboy_compress_h
We must add it even if we don't end up compressing because
it indicates that we might. This indication doesn't mean
that the user agent's accept-encoding values will ever
result in content encoding being applied.
2024-01-08 10:22:24 +01:00
Loïc Hoguin
e0adf0a19c
Don't fail actions if master cache doesn't exist 2024-01-08 09:54:34 +01:00
Loïc Hoguin
6ef79ae410
Reject HTTP/1 requests with both content-length and transfer-encoding
The previous behavior was to accept them and drop the
content-length header as per the RFC recommendation.
But since this behavior is not normal it is safer to
just reject such requests than risk security issues.
2024-01-05 16:32:59 +01:00
Loïc Hoguin
5b2f600036
Don't automatically compress when response has etag
In the cowboy_compress_h stream handler.

Otherwise this could cause issues with caching, with the
etag being the same for compressed/uncompressed content.

Users that wish to send etags AND compress will have to
do it manually for the time being.
2024-01-05 15:53:42 +01:00
Loïc Hoguin
67df6fedae
Add cowboy:get_env/2,3 2024-01-05 12:31:48 +01:00
Loïc Hoguin
8f49f8792a
Fix Dialyzer warnings caused by my decompress changes 2024-01-05 12:31:19 +01:00
Loïc Hoguin
fd9711d949
Rework and improve the decompress stream handler
The read buffer was changed into an iovec to avoid doing
too many binary concatenations and allocations.

Decompression happens transparently: when decoding gzip,
the content-encoding header is removed (we only decode
when "gzip" is the only encoding so nothing remains).

We always add a content_decoded key to the Req object.
This key contains a list of codings that were decoded,
in the reverse order in which they were. Currently it
can only be empty or contain <<"gzip">> but future
improvements or user handlers may see it contain more
values.

The option to disable decompression was renamed to
decompress_enabled and defaults to true.

It is no longer possible to enable/disable decompression
in the middle of reading the body: this ensures that the
data we pass forward is always valid.

Various smaller improvements were made to the code,
tests and manual pages.
2024-01-04 15:50:12 +01:00
jdamanalo
3ed1b24dd6
Add cowboy_decompress_h stream handler 2023-12-21 15:39:08 +01:00
Loïc Hoguin
ffbcdf534c
Don't update an HTTP/2 stream's window if stream stopped 2023-12-21 15:38:51 +01:00