Age | Commit message (Collapse) | Author |
|
Good in theory, but implementations may vary. If something stops
working after this commit we might need some tweaks to support
existing clients.
Please try it and give feedback.
|
|
|
|
It was only used by Safari 5.0.1 and possibly 5.1. Their market share
is dropping as we speak. It was also insecure (disabled in Firefox
for that reason).
This will allow us to make much more efficient and cleaner code for
the rest of the Websocket versions we support (drafts 7 to 17 + RFC),
which are pretty much all versions seen in the wild excluding the
one we're removing here.
|
|
Also small mostly insignificant changes to tests.
|
|
This behavior can be enabled with the `compress` protocol option.
See the `compress_response` example for more details.
All tests are now ran with and without compression for both HTTP
and HTTPS.
|
|
This changes the behavior of the `timeout` protocol option to
mean "Time in which the full request line and headers must be
received". The default of 5s should be fine for all normal uses.
This change has no noticeable impact on performance and is thus
enabled by default for everyone. It can be disabled by setting
`timeout` to `infinity` although that is definitely not encouraged.
Inspired by the contribution from @naryl on github.
|
|
Fix examples to follow new env tuple standard
|
|
This brings examples in line with the recent Middleware change.
|
|
This allows streaming a body without knowing the length in advance.
Also allows {stream, StreamFun} response body in the REST code.
|
|
|
|
It was added to help with response body streaming functions.
But it was a clumsy solution that we discarded in favor of
passing socket and transport to said function. It was also
very odd compared to the rest of the cowboy_req interface.
If you used this function before, worry not, here's its
proper equivalent.
[Socket, Transport] = cowboy_req:get([socket, transport], Req)
|
|
Before we were required to get the socket and transport ourselves,
now they're passed to the function.
|
|
First and foremost: yes, you can still use Cowboy as a rebar dependency.
This commit only removes the use of rebar when *developing* Cowboy, not
when *using* Cowboy.
Over the past two years I went from very happy with rebar to unsatisfied
and most recently found it counter productive in many ways, from having
insane default configuration to various unefficient operations. The earlier
reversal from 'rebar ct' to 'ct_run' made my workflow much more natural,
as I always needed to look at 'logs/raw.log' to find out what was wrong,
anyway. Why not let 'ct_run' output it directly instead? Removing rebar
made my life easier.
If you wonder why I don't patch rebar, there's two reasons. First is that
the direction taken by rebar isn't compatible with my views, and this
would be a huge fight to steer it in another direction. I got other,
more important fights to make. Second is that I'd rather patch OTP so
that everyone benefits from it, not just users of rebar.
Anyway this isn't my personal blog so I will stop babbling here. There's
a few important things to note relative to this commit:
* You don't need rebar to work on Cowboy anymore
* The eunit tests are now ran through common_test
Ping me if it doesn't work out for you.
|
|
|
|
Small tweak to the autobahn test file, we look for the python2
executable now. It'll make my life easier.
|
|
|
|
Middlewares allow customizing the request processing.
All existing Cowboy project are incompatible with this commit.
You need to change `{dispatch, Dispatch}` in the protocol options
to `{env, [{dispatch, Dispatch}]}` to fix your code.
|
|
|
|
|
|
Has some stuff that aren't in master yet, and lacks a lot more
that is already in master.
|
|
This function was badly thought out and would cause more harm
than good if used at all. Recommendation will be for people
who need to limit body length to check it beforehand or when
not possible to use the stream_body API.
|
|
|
|
This reverts commit cc65a723d70bb078b048bab81eeb8a4bd7ed39ce.
|
|
this change makes sure that once a request has been created
the error_terminate/3 function uses the original request instead
of making a new empty one with undefined values making the request
attributes easier to look at in many error cases
Conflicts:
src/cowboy_protocol.erl
|
|
|
|
|
|
This commit prevents erlang messages from keeping a websocket connection
alive. Previously, the timer was canceled upon any activity. Now, the
timeout is only canceled when actual data is sent from the client. The
handler_loop_timeout/1 function is called from websocket_data/4 instead
of handler_before_loop/4. It is also called after every successful reply
in handler_call/4.
|
|
|
|
|
|
|
|
|
|
This should be equivalent to what we do in Set-Cookie. Real-world
testing is needed to confirm it works as intended.
|
|
|
|
|
|
|
|
No more trying to quote, this is still completely broken everywhere.
|
|
|
|
|
|
|
|
|
|
The purpose of this patch is to make the arguments cowboy passes to
error_logger more consistent. With this patch there's only 3 variations
on the error_logger argument list; a 5 element list, an 8 element list
and a 10 element list. In all cases, the first 3 arguments are the
Module, Function and Arity of the function being called and the
second-to-last argument is always the Request. Additionally, for lists
longer than 5 elements, the last argument is always the stack-trace.
The added consistency of the argument ordering makes it much easier to
write code in lager's error_logger handler to catch these messages and
write a pretty one-liner (while writing the full message to the
crash.log).
|
|
Fix broken 'make docs'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Includes:
* cowboy_clock:rfc2109/1 now expects UTC datetime
* Rewrite of the cookie code to cowboy_http
* Removal of cowboy_cookies
* Add type cowboy_req:cookie_opts/0
Cookies should now be set using cowboy_req:set_resp_cookie/3.
Code calling cowboy_cookies directly will need to be updated.
|
|
|