Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
Checking mergeability… Don’t worry, you can still create the pull request.
This comparison is big! We’re only showing the most recent 250 commits
Commits on Nov 09, 2011
Loïc Hoguin Add 'If-Match' and 'If-None-Match' to parse_header/2 2f27b04
Commits on Nov 10, 2011
@nox nox Introduce cowboy_http:word/2
Used to parse either a token or a quoted string in parameters values.
@nox nox Introduce cowboy_http:media_type/2 b184b35
@nox nox Support 'Content-Type' in parse_header/2 6fa7659
Loïc Hoguin Merge branch 'content-type' of a5b47fd
Commits on Nov 24, 2011
Loïc Hoguin Fix specs for cowboy_http:language_range_ret/3 f1c94c4
Loïc Hoguin Fix default parsed values for the Accept and Accept-* headers dcc3d83
Commits on Nov 28, 2011
Loïc Hoguin Add set_resp_header/3 and set_resp_body/2 to cowboy_http_req
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.
Loïc Hoguin Fix a websocket test handler that was throwing an unwanted error
The test still worked because we expect the websocket connection
to fail, but it didn't fail exactly the way we wanted it to.
Loïc Hoguin Weekdays are binaries and not lists
Spotted by devinus on IRC.
Commits on Dec 01, 2011
Loïc Hoguin Change the returned value for language_range parsing
Considering how it must be used, a simple binary is much better
than a tag and a list of subtags. We still parse them like this
to make sure they follow the specs, though.
Commits on Dec 05, 2011
Loïc Hoguin Fix specs to allow headers as iodata() and not just binary() 99d8f83
Loïc Hoguin The semantics for a missing 'If-Match' aren't the same as '*' 7acaa99
Loïc Hoguin Add experimental Webmachine based REST protocol support
As with everything experimental, it probably has a lot of bugs and
may not even work.

Like Websocket, REST must be upgraded from a standard resource through
the init/3 function.

A key difference between Webmachine and Cowboy's REST protocol handler
is that in Cowboy the resource has direct access to the request object.
This makes a small change in a few places where you were expected to
return headers or body in Webmachine and are now expected to set them
directly yourself if needed (options/2, for example).

Another difference is that the functions rest_init/2 will always be
called when starting to process a request. Similarly, rest_terminate/2
will be called when the process completes successfully.

The Cowboy REST support also includes automatic language selection,
thanks to the languages_provided/2 callback.

Finally, Cowboy REST expects full URIs to be given at all times, and
will not try to reconstruct URIs from fragments.

Note that REST requests cannot be chained (keepalive) at this time.
This is a design issue in cowboy_http_protocol that will be fixed soon.

Check out the source for more details. It has been designed to be very
easy to read and understand so if you don't understand something,
it's probably a bug. Thanks in advance for all the great bug reports,
pull requests and comments you'll forward my way!
Commits on Dec 06, 2011
Loïc Hoguin cowboy_http_protocol shouldn't crash if the client sends HTTP responses
It was replying back the correct error, but with a crash message in
the console. This patch prevents it from crashing.

Fixes issue #94 reported by oribrost.
Loïc Hoguin Simplify the guards for cowboy_http_req:body/2 3649b0e
Loïc Hoguin Fix a crash in websocket_handshake/3 with hixie-76
Happened when an error occurred while trying to read the body to
get the key. Also fixes all the dialyzer warnings in cowboy_http_websocket.
Commits on Dec 07, 2011
Loïc Hoguin Add cowboy_http_req:set_resp_cookie/4
Pretty much just an alias for a combination of set_resp_header and cookie.
Magnus Klaar replace quoted:from_url with cowboy_http:urldecode
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.
Loïc Hoguin Merge branch 'noquoted' of 7f46e53
Commits on Dec 08, 2011
@maxlapshin maxlapshin peer_addr/1 function b9c70f2
Loïc Hoguin Allow HTTP protocol upgrades to use keepalive
REST needed this to be allowed to chain requests on the same connection.
Loïc Hoguin Add default values to known_methods and allowed_methods
Only allowing HEAD and GET requests by default.
Loïc Hoguin Merge branch 'master' of
Just fixed the indentation a bit.
Loïc Hoguin Add more documentation to the REST protocol handler 81fe059
Loïc Hoguin Fix the process_post/2 function in cowboy_http_rest 1684058
Commits on Dec 09, 2011
Magnus Klaar add cowboy_http:urlencode/2 and urlencode/1
This function complements the cowboy_http:urldecode/2
and urldecode/1 functions. We should have this encoding
covered now. urldecode is only expected to be invoked
by user code, no further changes needed to integrate this.
Commits on Dec 10, 2011
Magnus Klaar update /bits in binary expressions to /binary
This is a workaround for an issue in the hipe compiler where
compilation of code matching on binaries using patterns of the
form Data = <<Char, _Ignore/bits>> fails because _Ignore is
expected to be used. Using /binary instead of /bits resolves
the issue.

We're applying this change to all binary expressions in cowboy_http
because all functions in this module process human readable text
formats which are always expected to be bytestrings.

Two uses of /bits has been changed to /binary in cowboy_http_websocket
in two clauses of a single function, websocket_data/4. This is safe
to change because the data is later passed to binary:match/2 which
will always fail with a badarg error if the input is a bitstring
instead of a bytestring.
Commits on Dec 11, 2011
Magnus Klaar update cowboy_http_rest:variances/2
Fix pattern in case statement that was intended
to strip away the first comma separating the
values in the variance header.

Update generation of variance list to use more
idiomatic erlang. Pattern match on list structure
over using erlang:length/1 to compute length.
Commits on Dec 12, 2011
Loïc Hoguin Merge branch 'urlencode' of 57eb99f
@talentdeficit talentdeficit adds webmachine format content type handling 62bdb7d
Loïc Hoguin Merge branch 'master' of 7c1372d
Loïc Hoguin Merge branch 'hipe-compilation-fix' of a37dd71
Loïc Hoguin Fixes match_media_type in cowboy_http_rest
Based on the patch from Heinz N. Gies. The main change is that his
patch accept values such as */plain which we do not want.

Fixes issue #105.
Loïc Hoguin Merge branch 'variances-fix' of 874cdd3
Commits on Dec 15, 2011
Loïc Hoguin Add cowboy:accept_ack/1 for a cleaner handling of the shoot message e550ba7
Loïc Hoguin Reply status 400 if we receive an unexpected value or error for headers f81cb89
Loïc Hoguin Fix a dialyzer warning ce7084a
Loïc Hoguin Skip dependencies when running ct tests a7a6faf
Commits on Dec 16, 2011
Loïc Hoguin Remove -Wbehaviours dialyzer option unavailable in R15B 6214113
Magnus Klaar update type of resp_body to iodata
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.
Commits on Dec 17, 2011
Loïc Hoguin Merge branch 'resp-body-fix' of 7409311
Commits on Dec 19, 2011
Loïc Hoguin Add missing p_headers and cookies to compacted values f9bd5d1
Loïc Hoguin Add meta/2 and meta/3 to cowboy_http_req to save useful protocol info…

* cowboy_http_protocol now defines 'websocket_version' as metadata.
* cowboy_http_rest now defines 'media_type', 'language', 'charset' as metadata.
Loïc Hoguin create_path now returns a path, not an URI
Also add the new 'put_path' metadata information to the request
before entering the put_resource step (which proceeds to call
content_types_accepted and then the chosen content type's callback,
which is expected to use the 'put_path' value as the path to the new
resource instead of the original request path, because it may have
been changed by the create_path call.
Commits on Dec 22, 2011
Loïc Hoguin Move the websocket tests in a separate suite 9800348
Loïc Hoguin Add ct tests for binary websocket frames 7a68a38
Loïc Hoguin Websocket control frames payload length must be lower than 126 bytes eea6b2a
Loïc Hoguin Add a max_keepalive HTTP protocol option
Based on the patch by Louis-Philippe Gauthier.
Loïc Hoguin Remove outdated @todo notes and update another 17c9d45
Loïc Hoguin Add 'Upgrade' header parsing
Not parsing product tokens, I don't see much point.
Loïc Hoguin Update AUTHORS file 3d5f02a
Commits on Dec 26, 2011
Loïc Hoguin Add file 52c177f
Loïc Hoguin Use calendar date and time types exported since R14B04
Removes the cowboy_clock:date/0, time/0 and datetime/0 exported types.
Commits on Dec 28, 2011
Magnus Klaar Add cowboy_http_req:transport/1 function. 612b8f2
Magnus Klaar Add cowboy_http_req:set_resp_body_fun/3. 937a2b0
Magnus Klaar Add cowboy_http_req:set_resp_body_fun/3 to rest f56479f
Magnus Klaar Add built-in cowboy_http_static handler. ea7ae14
Magnus Klaar Add tests for #114 5057825
Commits on Jan 03, 2012
Magnus Klaar Add note on async threads to cowboy_http_static. 89870b2
Magnus Klaar Remove R14B and R14B01 from .travis.yml 5568a26
Loïc Hoguin Merge pull request #118 from klaar/travis-versions-fix
Remove R14B and R14B01 from .travis.yml
Loïc Hoguin Merge branch 'static-handler-split' of bd8f31e
Commits on Jan 04, 2012
Loïc Hoguin Add R15B to travis-ci's configuration file 5c10156
Yurii Rashkovskii inet_address:parse/1 does not accept binaries as an input, only strings ade1fb9
Loïc Hoguin Merge branch 'inet_parse_address_fix' of… 8ab0505
Commits on Jan 05, 2012
Magnus Klaar Add test and doc for content types function. 54d16c1
Magnus Klaar only run end_static_dir for http and https 1592adc
Loïc Hoguin Merge branch 'static-updates' of 5627277
Commits on Jan 06, 2012
Loïc Hoguin Merge branch 'issue-114-tests' of int…
…o gracefully-handle-crashes

Loïc Hoguin Move the ensure_response call before ensure_body_processed
We want to reply as soon as possible.
Loïc Hoguin Fix handler crashes handling
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.
Loïc Hoguin Fix the stream_body_set_resp test
It was failing from time to time due to the response being sent
as two separate packets.
Loïc Hoguin Make REST handlers' process_post accept true or false return values
They should return true when it has been processed successfully,
or false otherwise, in which case a 500 error is sent.

Fixes #119.
Loïc Hoguin Update CHANGELOG 45f37b8
Loïc Hoguin Update AUTHORS fd49215
Commits on Jan 07, 2012
Magnus Klaar Add etag option to cowboy_http_static handler. a7334d5
Commits on Jan 09, 2012
Loïc Hoguin Add HTTP handler loops to the README 9b620bb
Loïc Hoguin Merge branch 'static-etag-hook' of 348e225
Loïc Hoguin Make REST handlers' put_resource accept true or false return values
Followup to 0bb23f2.
As discussed in #119.
Loïc Hoguin Update version to 0.4.0 9ee120d
Commits on Jan 12, 2012
Loïc Hoguin Welcome to new developments with 0.5.0 e68bbfa
Commits on Jan 23, 2012
@nox nox Add multipart support 528507c
Loïc Hoguin Merge branch 'multipart' of
Loïc Hoguin Improve the listener name in the README 7482c0d
Loïc Hoguin Improve the return value for cowboy_http_rest:upgrade/4 3078e94
Loïc Hoguin Rename a lot of HandlerState2 variables to HandlerState 0761ef6
Loïc Hoguin Add {halt, Req, State} return value to most REST callbacks
Excluding generate_etag, last_modified, expires and variances.
Loïc Hoguin Fix typespecs for calendar:datetime/0 in cowboy_http_static 3667ec9
Loïc Hoguin Rename the type http_method/0 to cowboy_http:method/0
Exported types are much better than include files.
Loïc Hoguin Rename the type http_uri/0 to cowboy_http:uri/0 314483a
Loïc Hoguin Rename the type http_version/0 to cowboy_http:version/0 8622dff
Loïc Hoguin Rename the type http_header/0 to cowboy_http:header/0
At the same time rename http_headers/0 to cowboy_http:headers/0.
Loïc Hoguin Remove http_cookies/0, inline it directly in the record definition 67e5713
Loïc Hoguin Rename the type http_status/0 to cowboy_http:status/0 16d3cb7
Loïc Hoguin Remove http_resp_body/0, inline it directly in the record definition 7b35935
@bfrog bfrog added test for posting to a rest controller where forbidden returns t…
…rue on a keep alive socket
Loïc Hoguin Merge branch 'master' of dd08a90
Loïc Hoguin Fix a case where request body wouldn't get cleaned up on keepalive
The body was still in the buffer that's being used for the next
request and was thus used as a request, causing errors.
Commits on Jan 25, 2012
Magnus Klaar Add Autobahn test suite for websockets
We're using the existing test suite for websocket servers from the
Autobahn project to verify that out websockets implementation is
sane. A CT test suite and python module wrapping the test suite has
been added. The test suite is run when the 'make inttests' target
is executed.
Commits on Jan 26, 2012
@bfrog bfrog Handle delete better when no delete_resource function is implemented ca42ea1
Loïc Hoguin Merge branch 'rest_delete_no_call' of 9d73160
Loïc Hoguin Remove a leftover ct:print bb08cf8
Commits on Jan 30, 2012
Loïc Hoguin Move max_connections check directly inside cowboy_listener
This is a big change in the internal cowboy API. This should not
have any impact on existing applications as only the acceptor is
expected to use these API calls.

The function cowboy_listener:wait/3 has been removed. max_connections
checking now occurs directly in cowboy_listener:add_connection/3.
If the pool is full and the acceptor has to wait, then it doesn't
return, waiting for a free space to be available.

To accomodate these changes, it is now cowboy_listener that will
inform the new connection that it is ready by sending {shoot, self()}.
This should be a great improvement to the latency of responses as
there is one less message to wait for before the request process
can do its work.

Overall the performance under heavy load should also be improved as
we greatly reduce the number of messages sent between the acceptor
and the listener process.
Commits on Jan 31, 2012
Loïc Hoguin Add cowboy:get_protocol_options/1 and cowboy_set_protocol_options/2
This allows any application to upgrade the protocol options without
having to restart the listener. This is most useful to update the
dispatch list of HTTP servers, for example.

The upgrade is done at the acceptor level, meaning only new connections
receive the new protocol options.
Loïc Hoguin Pass --no_native option to dialyzer to improve dialyzing times
Goes from 36s to 24s on my laptop.
Loïc Hoguin Refactor cowboy_listener for more consistency 42bf0ea
Loïc Hoguin Use queue() for managing wait queues in cowboy_listener
The previous solution was retrieving the last put connection
and wasn't a real queue, so this solution should improve the
overall latency under load.
Loïc Hoguin Merge branch 'autobahn-suite' of
This needs python2 to be the default python in /usr/bin/python.
Loïc Hoguin Removing travis-ci from the cowboy development toolkit
We've been having many recurring issues, some which were fixed,
only to have other things broken again. Can't rely on a service
that breaks all the time.
@puzza007 puzza007 Remove call to queue:len/1
queue:len/1 is O(len(Q))
queue:out/1 is O(1) amortized, O(len(Q)) worst case

Replace with a pattern match
Loïc Hoguin Merge branch 'remove-queue-len-call' of… 2c0c85c
Commits on Feb 01, 2012
Loïc Hoguin Fix a typo that prevented protocol options upgrades 096f40b
Commits on Feb 02, 2012
Loïc Hoguin Apply a trick to the erlang:hibernate calls to suppress dialyzer warn…

Initially recommended by Magnus Klaar, the trick is to add a catch
instruction before the erlang:hibernate/3 call so that Dialyzer
thinks it will return, followed by the expected return value
('ok' for HTTP, 'closed' for websockets).

This should be good enough until a real solution is found.
David Kelly Added absoluteURI support
If requests go through a proxy, they will have the original uri in the
request, i.e. : GET http://proxy.server.uri/some/query/string  HTTP 1.1 ...

That was problematic -- cowboy_http_protocol:request didn't know what to
to with the result of decode_packet applied to this, which would be something

``` erlang

So, I just ignore the host, grab the path and pass into

``` erlang
cowboy_http_protocol:request({http_request, Method, {abs_path, Path},
	Version}, State)

Seems to do the trick without much effort.
Commits on Feb 08, 2012
@DeadZen DeadZen Add CA support and make SSL certificate password optional e67d839
Commits on Feb 20, 2012
Loïc Hoguin Add 'Expect' header parsing
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.
Loïc Hoguin REST: Only send 201 when a new resource is created on POST f6cf731
Loïc Hoguin Add an examples/ directory containing a link to cowboy_examples 9baf3e2
Loïc Hoguin Merge branch 'ssl-password-cacert' of 811d11a
Loïc Hoguin Check for upgrades on accept timeout
Otherwise acceptors will not be upgraded properly until after the
next request comes in.

Thanks to DeadZen for pointing it out.
Commits on Feb 21, 2012
@ostinelli ostinelli polished dialyzer warnings on supervisor init/1 specs f3de086
Commits on Feb 23, 2012
Loïc Hoguin Add cowboy_http:x_www_form_urlencoded/2
This was initially an internal function, it has been made public
due to popular demand as it can sometimes be needed.
Commits on Feb 24, 2012
Loïc Hoguin Add an empty ebin/ folder to fix a rebar/edoc issue
When missing rebar couldn't build docs because it expects the ebin/
folder to exist before it runs edoc. This commit allows users to
build docs without first having to run make.
@essen essen Merge pull request #146 from ostinelli/f3de0869801d3909cc5a5d5dbee819…

Polish dialyzer warnings on supervisor init/1
Commits on Feb 27, 2012
Loïc Hoguin Remove a completed @todo comment ac1424f
Loïc Hoguin Remove the redundant include/ from -include("http.hrl") d9212c2
Loïc Hoguin Add a roadmap 8f0a78f
Commits on Feb 29, 2012
Magnus Klaar Tests and fixes for the generate_etag/2 callback
The return value from the generate_etag/2 callback is expected to be a
binary tagged with either weak or strong. This binary is quoted, and
may be prefixed with W/ before it is set as the value of the ETag header
in the response.

For backwards compatibility with older handlers where the return value
was expected to be a quoted binary a function has been added to parse any
return values that are untagged binaries. All untagged binaries are expected
to be a valid value for the ETag header.
Commits on Mar 02, 2012
Loïc Hoguin Merge branch 'rest-etag-fixes' of c6c2b31
Commits on Mar 08, 2012
@dysinger dysinger If we have a mapping to '*' then use it as the default catch all accept 21cd61c
Commits on Mar 09, 2012
@asabil asabil Make media type parsing more relaxed
Certain user agents send slightly invalid media types, like the
following: "text/html, image/gif, image/jpeg, ; q=.2, */; q=.2"

The user agent with which this behavior was observed presented itself
with the User-Agent string: "Mozilla/5.0 (Macintosh; U; Intel Mac OS X
10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (FlipboardProxy/0.0.5;
Magnus Klaar Fix issue #157 relating to daylight savings time. 3376b72
Loïc Hoguin Merge branch 'cookie-expire-fix' of 5d46ad0
Commits on Mar 12, 2012
Loïc Hoguin Rename inet:ip_port() to inet:port_number()
Thanks go to @superbobry for pointing it out.
Loïc Hoguin Merge branch 'fix/relax-media-type-parsing' of… 133564d
Commits on Mar 13, 2012
Loïc Hoguin Merge branch 'content-type-accepted-asterisk-atom' of https://github.…

Added a comment explaining the '*' always matching.
Loïc Hoguin Do not send chunked Transfer-Encoding replies for HTTP/1.0
Fixes compatibility issue #140 reported by @majek.
Commits on Mar 15, 2012
Loïc Hoguin Add an 'onrequest' hook for HTTP
This new protocol option is a fun.

It expects a single arg, the Req, and should only return a possibly
modified Req. This can be used for many things like URL rewriting,
access logging or listener-wide authentication.

If a reply is sent inside the hook, then Cowboy will consider the
request handled and will move on to the next one.
Loïc Hoguin Don't close requests when the replied body is chunked 7e74582
Commits on Mar 21, 2012
@asabil asabil Simplify the options filtering code in cowboy_ssl_transport 98c5828
@asabil asabil Add support for specifying the ciphers for the SSL transport 9ac784d
Commits on Mar 22, 2012
@si14 si14 Fixing badmatch when browser closes connection earlier than file was …
…fully sent
Commits on Mar 23, 2012
Loïc Hoguin Merge branch 'patch-1' of 7b2793b
@asabil asabil Update the edoc for cowboy_ssl_transport:listen/1 0c2cb20
Loïc Hoguin Merge branch 'add-ssl-ciphers-configuration' of… 4fb2a6f
Commits on Apr 01, 2012
Magnus Klaar Convert request to proplist when logging 5a7040e
Loïc Hoguin Merge branch 'log-proplist-req' ba75e8b
Loïc Hoguin Add chunked transfer encoding support and rework the body reading API
Introduces 3 low level functions and updates the existing higher
levels functions. The new primitives are has_body/1, body_length/1
and stream_body/1. In addition to that, a helper function
init_stream/4 has been added.

Streaming a body implies to decode the Transfer-Encoding and
Content-Encoding used for the body. By default, Cowboy will try
to figure out what was used and decode them properly. You can
override this if you want to disable this behavior or simply
support more encodings by calling the init_stream/4 function
before you start streaming the body.
Commits on Apr 05, 2012
Magnus Klaar Add support for fragmented websocket messages 0b15ed9
Commits on Apr 06, 2012
Magnus Klaar Update autobahn suite to use autobahntestsuite 80c67bf
@Vagabond Vagabond Add sockname/1 to the TCP and SSL transports 06a2d63
Loïc Hoguin Merge branch 'websocket-fragments' of e8ee647
Loïc Hoguin Merge branch 'adt-add-sockname' of 85ed79e
Commits on Apr 08, 2012
@asabil asabil Make charsets parsing more relaxed
Certain user agents send invalid Accept-Charset headers, like the
following: "ISO-8859-1;utf-8;q=0.7,*;q=0.7"

The user agent with which this behavior was observed presented itself
with the User-Agent string: "Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.9) Gecko/2008052906 Firefox/3.0" Although this doesn't
appear to be correct. The request might have been mangled by a
transparent proxy.
Commits on Apr 12, 2012
Loïc Hoguin Use a separate rebar.config file for running tests 4b27d3e
Loïc Hoguin Cleanup the .gitignore 1219837
Commits on Apr 13, 2012
Loïc Hoguin Add a clean-docs target to the Makefile bc2d53d
Commits on Apr 24, 2012
@etrepum etrepum use erlang:start_timer/3 instead of erlang:send_after/3 for handling …
Commits on Apr 28, 2012
Loïc Hoguin Add .cowboy.plt to the gitignore 845d306
Commits on Apr 29, 2012
Loïc Hoguin Fix and rework the HTTP test suite
Use a proper HTTP client to run all tests. This client is currently
undocumented and should not be used.

Includes a few fixes:

* Fix a bug in the max_keepalive test
* Fix a bug with max_keepalive handling
* Fix a bug in stream_body/1 where data was lost under some conditions

The tests now run quite faster than before.

All the tests now run twice: once for TCP, once for SSL.
Commits on Apr 30, 2012
Loïc Hoguin Merge branch 'cowboy-client' 48a2b17
Magnus Klaar Add file option to cowboy_http_static 8168ae9
Loïc Hoguin Refactor the reply functions 7ed93fc
Commits on May 02, 2012
Loïc Hoguin Add a test for HTTP handlers loop timeouts dab6648
Commits on May 03, 2012
Loïc Hoguin Merge branch 'cancel-timer' of 1524ba4
Commits on May 04, 2012
Loïc Hoguin Add an 'onresponse' hook
This new protocol option is a fun.

It expects 3 args: the Status code used in the reply (this is the
cowboy_http:status() type, it can be an integer or a binary), the
headers that will be sent in the reply, and the Req. It should
only return a possibly modified Req. This can be used for many
things like error logging or custom error pages.

If a reply is sent inside the hook, then Cowboy will discard the
reply initially sent. Extra caution must be used in the handlers
making use of inline chunked replies as they will throw an error.

This fun cannot be used as a filter, you can either observe the
reply sent or discard it to send a different one instead.

The hook will not be called for replies sent from inside the hook.
Loïc Hoguin Merge branch 'response-hook' 0406a63
Loïc Hoguin Add a note about crypto websocket usage in the doc comments 14b45fd
@yrashk yrashk Fixes invalid type specification for cowboy_http_req:multipart_data/1 d495582
Commits on May 05, 2012
Loïc Hoguin Add a test for empty path segments 376d537
Loïc Hoguin Merge branch 'patch-1' of 5ffeb9e
Loïc Hoguin Add a test checking requests with size around the MTU 90bae59
Commits on May 06, 2012
@nox nox Add new HTTP status codes from RFC 6585
See for further details.
Commits on May 14, 2012
@essen essen Merge pull request #216 from nox/rfc6585
Add new HTTP status codes from RFC 6585
@bfrog bfrog Only ignore slashes in cookie values for the path
* Ensures cookie encoding errors are caught earlier
* Fix separator misspelling
Commits on May 21, 2012
Loïc Hoguin Small updates to the ROADMAP and doc comments 8363e89
Loïc Hoguin Make multipart code use stream_body ca9278b
Loïc Hoguin Fix a bug preventing 'onresponse' from being called on errors cc6c4e3
Loïc Hoguin Merge branch 'fix/relax-conneg-parsing' of… 040c6dc
Loïc Hoguin Merge branch 'serve-static-file' of
Fix alphabetical order since @klaar seems to have issues with it. ;)
Loïc Hoguin Merge branch 'cookie_slash' of a95245d
Loïc Hoguin Remove a dumb warning when running the tests 1a1b01c
Commits on May 23, 2012
Loïc Hoguin Update version to 0.6.0
Also update the CHANGELOG and copyright years.
Commits on Jul 13, 2012
@essen essen Add an Hello World example b8a25b1
Commits on Jul 14, 2012
@essen essen Add a simple Static File Server example 86f9f48
Commits on Jul 21, 2012
@essen essen REST: Fix charset matching 95ed134
@essen essen REST: Normalize content types accepted
Same as content types provided, we accept the <<"application/json">> form.
Commits on Jul 22, 2012
@essen essen Add support for Expect: 100-continue
This makes uploading files with curl a lot faster than without.
@essen essen Add a GET echo example 370b3d9
@essen essen Add a POST echo example 73c0737
@essen essen Add a Chunked Hello World example 6ea32d6
@essen essen Add a REST Hello World example f212caf
@essen essen Look for parsed headers in the cache before trying to parse adc3639
@essen essen Remove an useless todo bab6290
Commits on Jul 23, 2012
Josh Marchán Don't save parsed value in the Host header f3c5881
@essen essen Improve typespecs 76d6ed8
Commits on Jul 31, 2012
@seven1240 seven1240 Fix stream_body when used by multipart 2645044
Commits on Aug 08, 2012
@essen essen Update version to 0.6.1 af07e04
Commits on Aug 09, 2012
@essen essen Update AUTHORS file 50e5a61
Commits on Aug 27, 2012
@essen essen Switch to Ranch for connection handling
This is the first of many API incompatible changes.

You have been warned.
@essen essen Have only one -export and -export_type per line
This should make easier spotting additions and removals in commits.
@essen essen Change a websocket error from {error, protocol} to {error, badframe}
For improved consistency.
@essen essen Update behaviours for R15B+
This effectively drops the R14B compatibility.

The cowboy_req:req() type will be introduced in a future commit.
It refers to the #http_req{} record.
@essen essen Rename cowboy_http_protocol to cowboy_protocol 9e2622b
@essen essen Rename cowboy_http_req to cowboy_req d3dcaf1
@essen essen Rename cowboy_http_rest to cowboy_rest 6d84afd
@essen essen Rename cowboy_http_static to cowboy_static f39c001
@essen essen Rename cowboy_http_websocket to cowboy_websocket 0e3adf1
@essen essen Introduce a cowboy_req:req/0 type
Cleanup the typespecs of the cowboy_req module following this.
Commits on Sep 10, 2012
@essen essen Replace cowboy_req:host/1 with cowboy_req:raw_host/1
The latter is much more useful than the former, which ends up
being removed.
@essen essen Replace cowboy_req:path/1 with cowboy_req:raw_path/1
The latter is much more useful than the former, which ends up
being removed.
Commits on Sep 14, 2012
@essen essen Separate multipart from body_state 4040a9f
@essen essen Change type #http_req{} to cowboy_req:req()
This removes cowboy_static's dependency on http.hrl.
Commits on Sep 15, 2012
@essen essen Remove two unneeded Req modifications 9b5cbb5
@essen essen Add a cowboy_req:to_list/1 function
Removes a lot of duplicate code when printing error messages.
@essen essen Put socket and transport into cowboy_websocket's #state{}
As part of the work to make cowboy_req:req() opaque.
@essen essen Avoid a duplicate HTTP reply in cowboy_websocket:upgrade_error/1
Do this by checking whether we received the resp_sent message.
@essen essen Add cowboy_req:url/1 to return the full request URL
Use it in cowboy_websocket for hixie76, replacing http by ws.
@essen essen Remove duplicate code for ensure_response 0aaa717
@essen essen Use skip_body directly between requests
There's no need for more complex logic now that we have
the API for it.
@essen essen Introduce cowboy_req:set_meta/3 to set request metadata 9ef94fb
@essen essen Put the method in cowboy_rest's #state{} 736bcd4
@essen essen Introduce cowboy_req:host_url/1 to remove more duplicate code 527477b
Commits on Sep 16, 2012
@essen essen Add cowboy_req:delete_resp_header/2
Both requested and better for making Req opaque.
Commits on Sep 17, 2012
@essen essen Improve consistency of return types for cowboy_req API
The signature of parse_header, body_qs, multipart_data and
the set_resp_* functions has changed.

See the cowboy_req module edoc for more details.
@essen essen Add a function to lock request responses instead of inlining
Just more cleanup in order to have req() opaque.
@essen essen Remove http.hrl dependency in cowboy_rest
Only cowboy_protocol remaining now.
@essen essen Use cowboy_req:version/1 in cowboy_protocol where applicable
More cleanup towards making cowboy_req:req() opaque.
@essen essen Add a private cowboy_req function to create a Req object
Private means you must not used it. It's meant for internal use.
@essen essen Add the private function set_host/4 used by cowboy_protocol 350d4ae
@essen essen Add the private set_connection/2 function used by cowboy_protocol 905083a
@essen essen Add the private add_header/3 function used by cowboy_protocol fc02b7f
@essen essen Add the private set_buffer/2 function used by cowboy_protocol 5b56dd7
@essen essen Add the private set_bindings/4 function used by cowboy_protocol c1dd5b5
@essen essen Add the private get_resp_state/1 function used by cowboy_protocol e55ec7d
@essen essen Add the private get_buffer/1 function used by cowboy_protocol cf0e905
@essen essen Add the private get_connection/1 function used by cowboy_protocol
This removes cowboy_protocol's dependency on http.hrl!
@essen essen Make cowboy_req:req() opaque
Remove http.hrl in the process.

If you feel furious about this change after reaching this commit,
don't worry! You probably just need a few access or modification
functions to be added in cowboy_req for your needs. Problem is,
I don't know these. I'll be very thankful if you can open a ticket
and tell me all about it so the best solution can be swiftly
implemented to make you happy again.
@essen essen Include the eunit file only if TEST is defined 13b743b
@essen essen Rename cowboy_req:raw_qs/1 to cowboy_req:qs/1 18be3a8
@essen essen Replace many proplists:get_value/{2,3} calls by BIFs
Originally suggested by Roberto Ostinelli.
@essen essen Add types for onrequest and onresponse funs c2be7c1
@essen essen Update CHANGELOG f6791b0
Commits on Sep 21, 2012
@essen essen Don't use decode_packet/3 for parsing the request-line
First step in making all methods and header names binaries to
get rid of many inconsistencies caused by decode_packet/3.

Methods are all binary now. Note that since they are case
sensitive, the usual methods become <<"GET">>, <<"POST">> and so on.
@essen essen Don't use decode_packet/3 for parsing the headers
Header names are now binaries. Since header names are case insensitive
they are all converted to lowercase. For example: <<"content-length">>.

The max_line_length option was removed. Three new options have been
added instead:

 *  max_request_line_length (defaults to 4096)
 *  max_header_name_length (defaults to 64)
 *  max_header_value_length (defaults to 4096)
@essen essen Make multipart part headers binary lowercase
Here we do not remove decode_packet yet, we just lowercase the
header name and transform it into a binary if needed, to fix
the consistency issue.
@essen essen Update CHANGELOG 981ea35
Commits on Sep 30, 2012
@RJ RJ add websockets example a74fbd7
@RJ RJ implement x-webkit-deflate-frame for websockets 675a648