0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 12:40:25 +00:00
Commit graph

23 commits

Author SHA1 Message Date
Loïc Hoguin
73f65d5a75 Document the HTTP status codes Cowboy may send in the manual
422 is left out as it's soon to be replaced by 400.
2014-06-26 14:32:20 +02:00
Drew Varner
6ed25fd60b Allow users to pass a raw binary() as the expires header. 2014-06-10 00:12:26 +02:00
Loïc Hoguin
0c37925642 Add request body reading options
The options were added to allow developers to fix timeout
issues when reading large bodies. It is also a cleaner and
easier to extend interface.

This commit deprecates the functions init_stream, stream_body
and skip_body which are no longer needed. They will be removed
in 1.0.

The body function can now take an additional argument that is a
list of options. The body_qs, part and part_body functions can
too and simply pass this argument down to the body call.

There are options for disabling the automatic continue reply,
setting a maximum length to be returned (soft limit), setting
the read length and read timeout, and setting the transfer and
content decode functions.

The return value of the body and body_qs have changed slightly.
The body function now works similarly to the part_body function,
in that it returns either an ok or a more tuple depending on
whether there is additional data to be read. The body_qs function
can return a badlength tuple if the body is too big. The default
size has been increased from 16KB to 64KB.

The default read length and timeout have been tweaked and vary
depending on the function called.

The body function will now adequately process chunked bodies,
which means that the body_qs function will too. But this means
that the behavior has changed slightly and your code should be
tested properly when updating your code.

The body and body_qs still accept a length as first argument
for compatibility purpose with older code. Note that this form
is deprecated and will be removed in 1.0. The part and part_body
function, being new and never having been in a release yet, have
this form completely removed in this commit.

Again, while most code should work as-is, you should make sure
that it actually does before pushing this to production.
2014-06-02 23:09:43 +02:00
Loïc Hoguin
23eb3f8e9a Fix manual for content_types_provided 2014-04-17 13:38:42 +02:00
Loïc Hoguin
17af50812c Remove outdated comments, all edoc, plus a few minor tweaks 2014-03-26 19:05:59 +01:00
Sina Samavati
4ff6b0238b Fix cowboy:stop_listener/1 spec in manual 2014-02-21 00:31:38 +03:30
Loïc Hoguin
917cf99e10 Add and document the new multipart code
The old undocumented API is removed entirely.

While a documentation exists for the new API, it will not
be considered set in stone until further testing has been
performed, and a file upload example has been added.

The new API should be a little more efficient than the
old API, especially with smaller messages.
2014-02-06 19:36:25 +01:00
Loïc Hoguin
b09f3a570d Clarify what stream_body is doing 2014-01-23 15:54:20 +01:00
Loïc Hoguin
7a274661b2 Fix typespecs for cowboy_req:binding/{2,3} and :bindings/1 2013-12-28 20:10:06 +01:00
Loïc Hoguin
6907541a78 Clarify functions that can only be called once 2013-12-28 18:04:14 +01:00
Klaus Trainer
d139b6f110 manual: Add note about cowlib 2013-11-26 21:13:43 +01:00
Loïc Hoguin
5a25c7f7f2 Add link to cowboy_spdy function reference in index 2013-11-14 17:03:13 +01:00
Loïc Hoguin
119d52295f Add documentation for cowboy_spdy 2013-11-14 16:46:31 +01:00
Loïc Hoguin
6672ea0415 Review, improve and document the static files handler
Changes include:

 *  Much simplified route configuration.

 *  Etag generation is now enabled by default.

 *  Web mimetypes are now detected by default. A bigger list of
    mimetypes can be detected without any additional library.

 *  Mimetypes can no longer be specified as a list. Copying this
    list for new connections is too costy. You can easily convert
    it into a function and pass that function to the handler instead.

 *  You can however specify a single hardcoded mimetype. Mostly
    useful when serving a single file, like an index.html file,
    to avoid extra operations.

 *  Specifying a path as a list of tokens is not possible anymore.
    Use either a binary or a string.

 *  Using a private directory will not work if the application
    was not started properly. Cowboy will not attempt to find
    the location of this directory if the VM doesn't know it,
    as this caused issues in some setups.

 *  Overall the code has been much simplified and clarified,
    and of course has now been documented.
2013-11-02 14:41:46 +01:00
Loïc Hoguin
8a77c8f753 Alphabetical order 2013-08-27 18:14:31 +02:00
RJ
83d85e641a add websocket_compress metadata 2013-08-15 10:47:18 +01:00
Eduardo Gurgel
d0bbf11119 Fix qs_vals description on missing value for a name 2013-07-08 14:30:53 -03:00
Loïc Hoguin
fdf2bc93f6 Add asn1 to the list of applications to be started for SSL
Required since R16B01. And apparently needed in some cases before.
2013-06-20 16:01:58 +02:00
Loïc Hoguin
4fde6cba94 In content-types, the charset parameter is converted to lowercase
We know this specific parameter is case insensitive so we
automatically lowercase it to make things simpler to the
developer.
2013-05-31 18:38:43 +02:00
Loïc Hoguin
8fac4eedcf Improve generate_etag return value description 2013-05-31 15:23:53 +02:00
Loïc Hoguin
c7f0834dc3 manual: Fix a typo in a typespec 2013-05-25 17:50:16 +02:00
Loïc Hoguin
cadde391f7 manual: Add a missing return type for generate_etag 2013-05-25 17:49:09 +02:00
Loïc Hoguin
666c59bc42 Add the Cowboy Function Reference
The manual details every stable public functions of Cowboy.
2013-05-17 13:13:27 +02:00