Age | Commit message (Collapse) | Author |
|
Now Cowboy checks headers sent to the client for the 'Connection'
header value, parses it, and checks whether it contains a 'close'
or 'keep-alive' value. It makes sure to close or keep the connection
alive depending on the value found there, if any.
Also change chunked replies to not close the connection by default
unless the application requests it.
|
|
I know it is unlikely to use plain TCP on port 443, where SSL is
usually used, but a bug is still a bug, and as such it should be fixed.
Now the port will be probably appended to the location when port 443
is used without SSL.
|
|
Also add a call to compact/1 in the websocket test handler so we may
catch bugs related to it faster later on.
|
|
From the RFC:
The HEAD method is identical to GET except that the server MUST NOT
return a message-body in the response. The metainformation contained
in the HTTP headers in response to a HEAD request SHOULD be identical
to the information sent in response to a GET request.
|
|
Replaces the 'Connection' interpretation in cowboy_http_protocol
from raw value to the parsed value, looking for a single token
matching close/keep-alive instead of the whole raw value (which
could contain more than one token, for example with Firefox 6+
using websocket).
Introduce the functions cowboy_http_req:parse_header/2 and /3
to semantically parse the header values and return a proper
Erlang term.
|
|
|
|
Use the Req connection information instead.
|
|
And use a proper cowboy_http_req:reply/4 call for the 204 response.
|
|
|
|
The server should not send a response if there wasn't at least
the beginning of a request sent (the Request-Line).
|
|
Thanks to @nivertech for pointing it out in ticket #61.
|
|
Thanks to @klaar for pointing it out in ticket #59.
|
|
|
|
|
|
|
|
|
|
|
|
Making it look more like the websocket handler error messages.
|
|
|
|
|
|
|
|
The issue was that we were calling erlang:hibernate before a
receive .. after .. end call. Erlang hibernates the process before
reaching the receive instruction and we therefore couldn't enter
the after clause when hibernating.
This is now fixed by using erlang:send_after instead and receiving
that message instead of using an after clause.
|
|
Also improve the documentation about hibernate.
|
|
Krishnamurthy, Kristol, Mogul: "Key Differences between HTTP/1.0
and HTTP/1.1", "Internet address conservation".
http://www8.org/w8-papers/5c-protocols/key/key.html
Fixes issue #35 reported by Alex Kropivny.
|
|
Fixes issue #47.
|
|
Responses to the HEAD requests used to include an response body.
|
|
|
|
|
|
The implementation is only partial for now but should work for
all browsers implementing it.
|
|
To this end we are formatting the header names just like OTP does
except we do it for names of up to 32 characters, as there are
widely used header names of more than 20 characters, the limit that
OTP follows currently. An example of such header name would be
Sec-Websocket-Version.
The formatting itself is fairly simple: an uppercase character at
the start and after dashes, everything else lowercase.
|
|
Until calendar exports them at least.
|
|
Also sends a message 'shoot' that can be received by the protocol
to make sure Cowboy has had enough time to fully initialize the
socket. This message should be received before any socket-related
operations are performed.
WebSocket request connections are now moved from the pool 'default'
to the pool 'websocket', meaning we can have a lot of running
WebSockets despite having a low 'max_connections' setting.
|
|
Currently only supports limiting the maximum number of
connections by managing connection pools.
|
|
|
|
|
|
|
|
|
|
Based on Mochi Media, Inc.'s work in Mochiweb.
Conflicts:
rebar.config
|
|
This fixes issue #33.
|
|
Should be good for both GET and POST query strings.
This adds https://github.com/klaar/quoted.erl as a dependency.
Props to klaar for this code.
|
|
Improves the readability of websocket handler code by having
two functions: websocket_handle/3 handles the packets received
from the socket, removing the tuple construct that was otherwise
needed, so only websocket_handle(Data, Req, State) is needed now;
websocket_info/3 handles the messages that the websocket handler
process received, as websocket_info(Info, Req, State).
Both functions return values are handled identically by Cowboy
so nothing changes on that end.
|
|
Idea given by bfrog, fixes issue #34.
|
|
This ensures that an error thrown in handler_terminate/4 will be
shown after the error from handler_call/6, in the expected order.
As we already call WebSocketHandler:terminate/3, this should
fix issue #23.
|
|
This ensures we can cleanup what we did in Handler:init/3.
|
|
Fixes issue #31.
Recursion shouldn't happen in a single catch statement or inside
a try .. catch statement. The only safe construct for catching
exceptions and perform recursion when everything goes well is
to put the recursive call inside a try .. of .. catch construct
in the of .. catch block.
Otherwise the stack gets filled with exception-related information
since they can still be caught if we were to send them and unfold
the whole thing.
Thanks go to lpgauth for reporting the issue and people on IRC
for explaining the hows and whys.
|
|
This is probably not perfect yet but it should be better than
nothing. We'll improve things with feedback received from the
many users.
|
|
|
|
Found thanks to warn_missing_spec and added with the help of typer.
Eunit functions do not have specs yet however.
|
|
Browsers get mad that the returned location address is not the same
as what they sent, since the :(80|443) is stripped.
Add a simple eunit test due to existing ct websockets tests not
covering this case.
|
|
|