Age | Commit message (Collapse) | Author |
|
At the same time renaming cowboy_http:content_type_params/3 to
cowboy_http:params/2 (with a default Acc of []) as this code isn't
useful only for content types.
|
|
|
|
At the same time rename http_headers/0 to cowboy_http:headers/0.
|
|
|
|
Exported types are much better than include files.
|
|
Conflicts:
src/cowboy_http_req.erl
test/http_SUITE.erl
|
|
|
|
We try to send a 500 error only if we didn't send the response
headers yet. If they were, then we have no way to be sure the
response was fully sent, nor should we assume anything about
how this will be handled client-side, so we do nothing more
and in both cases close the connection.
|
|
|
|
|
|
|
|
|
|
Not parsing product tokens, I don't see much point.
|
|
* cowboy_http_protocol now defines 'websocket_version' as metadata.
* cowboy_http_rest now defines 'media_type', 'language', 'charset' as metadata.
|
|
|
|
resp_body is set by cowboy_http_req:set_resp_body/2 which accepts
the input type iodata(). Update the resp_body field to use the same
type. Also update the cowboy_http_req:has_resp_body/2 function to
use the iolist_size/1 which works with both binary() and iolist()
values instead of the byte_size/1 function which only works with
binary() values.
|
|
Just fixed the indentation a bit.
|
|
|
|
|
|
This change makes the dependency on quoted optional
by adding a minimal urldecode function to cowboy.
A protocol option for setting the urldecoding function
has been added to the cowboy_http_protocol module.
The default value for this option is set to be
equivalent to the default settings for quoted.
{fun cowboy_http:urldecode/2, crash}
A note has been added in the README to document
how to use quoted instead of this function.
A field to store this option value has been added
to the state record in the cowboy_http_protocol
module and the http_req record in include/http.hrl
Functions that previously used quoted:from_url/1
has been updated to require an equivalent function
in addition to the previously required arguments.
This change removes a C compiler from the build
requirements of cowboy. It also removes the requirement
to cross compile the code if the target arch/OS
is different from the arch/OS used to build it.
|
|
Pretty much just an alias for a combination of set_resp_header and cookie.
|
|
|
|
|
|
|
|
These functions allow to set response headers and body in advance,
before calling any of the reply functions.
Also add has_resp_header/2 and has_resp_body/1 to check if the given
response headers have already been set.
|
|
|
|
|
|
|
|
|
|
|
|
Implementing the full HTTP-date type (RFC1123, RFC850, asctime).
|
|
Conflicts:
src/cowboy_http.erl
|
|
|
|
Sorry I apparently used an outdated RFC when I was doing this.
|
|
|
|
|
|
|
|
Rework the cowboy_http_req:parse_header/2 function while I was at it.
|
|
|
|
This function doesn't try to add any additional header besides the
Connection: Upgrade header. It also doesn't accept a body.
It should be used for the intermediate reply to an upgrade process,
before the real reply is sent (if any, for example when using TLS).
|
|
Introduce cowboy_http's list/2, nonempty_list/2, token/2 functions.
|
|
New functions are reply/2, reply/3, chunked_reply/2 in cowboy_http_req.
|
|
|
|
|
|
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.
|
|
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.
|
|
Thanks to @klaar for pointing it out in ticket #59.
|
|
|