0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 20:50:24 +00:00
Commit graph

1986 commits

Author SHA1 Message Date
Loïc Hoguin
fd211d3c03 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.
2012-01-06 20:23:59 +01:00
Loïc Hoguin
ba87aa4193 Move the ensure_response call before ensure_body_processed
We want to reply as soon as possible.
2012-01-06 19:20:17 +01:00
Loïc Hoguin
5095c27c65 Merge branch 'issue-114-tests' of https://github.com/klaar/cowboy into gracefully-handle-crashes
Conflicts:
	test/http_SUITE.erl
2012-01-06 19:19:34 +01:00
Loïc Hoguin
5627277aa2 Merge branch 'static-updates' of https://github.com/klaar/cowboy 2012-01-05 01:04:12 +01:00
Magnus Klaar
1592adcd4e only run end_static_dir for http and https 2012-01-05 01:01:03 +01:00
Magnus Klaar
54d16c14ad Add test and doc for content types function. 2012-01-05 01:01:03 +01:00
Loïc Hoguin
8ab05058e6 Merge branch 'inet_parse_address_fix' of https://github.com/spawngrid/cowboy 2012-01-05 00:19:41 +01:00
Yurii Rashkovskii
ade1fb93ca inet_address:parse/1 does not accept binaries as an input, only strings 2012-01-04 15:13:14 -08:00
Loïc Hoguin
5c101560df Add R15B to travis-ci's configuration file 2012-01-04 23:23:22 +01:00
Loïc Hoguin
bd8f31ed07 Merge branch 'static-handler-split' of https://github.com/klaar/cowboy 2012-01-03 23:39:45 +01:00
Loïc Hoguin
063f64a02a Merge pull request #118 from klaar/travis-versions-fix
Remove R14B and R14B01 from .travis.yml
2012-01-03 13:51:49 -08:00
Magnus Klaar
5568a26d3c Remove R14B and R14B01 from .travis.yml 2012-01-03 16:49:07 +01:00
Magnus Klaar
89870b22d9 Add note on async threads to cowboy_http_static. 2012-01-03 16:29:32 +01:00
Magnus Klaar
50578254d5 Add tests for #114 2011-12-29 00:06:22 +01:00
Magnus Klaar
ea7ae14df8 Add built-in cowboy_http_static handler. 2011-12-28 18:17:15 +01:00
Magnus Klaar
f56479ffc2 Add cowboy_http_req:set_resp_body_fun/3 to rest 2011-12-28 18:17:15 +01:00
Magnus Klaar
937a2b0326 Add cowboy_http_req:set_resp_body_fun/3. 2011-12-28 18:17:10 +01:00
Magnus Klaar
612b8f21fe Add cowboy_http_req:transport/1 function. 2011-12-28 18:15:47 +01:00
Loïc Hoguin
156c84ff29 Use calendar date and time types exported since R14B04
Removes the cowboy_clock:date/0, time/0 and datetime/0 exported types.
2011-12-26 10:17:29 +01:00
Loïc Hoguin
52c177fa6f Add CHANGELOG.md file 2011-12-26 08:40:18 +01:00
Loïc Hoguin
3d5f02af0e Update AUTHORS file 2011-12-22 22:18:19 +01:00
Loïc Hoguin
298ba1f1bb Add 'Upgrade' header parsing
Not parsing product tokens, I don't see much point.
2011-12-22 22:10:00 +01:00
Loïc Hoguin
17c9d45786 Remove outdated @todo notes and update another 2011-12-22 21:48:24 +01:00
Loïc Hoguin
72d91583b9 Add a max_keepalive HTTP protocol option
Based on the patch by Louis-Philippe Gauthier.
2011-12-22 21:35:40 +01:00
Loïc Hoguin
eea6b2ab80 Websocket control frames payload length must be lower than 126 bytes 2011-12-22 21:00:09 +01:00
Loïc Hoguin
7a68a38e5a Add ct tests for binary websocket frames 2011-12-22 20:19:05 +01:00
Loïc Hoguin
9800348c21 Move the websocket tests in a separate suite 2011-12-22 20:06:58 +01:00
Loïc Hoguin
c54c361adb 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.
2011-12-19 10:29:44 +01:00
Loïc Hoguin
f390dbd606 Add meta/2 and meta/3 to cowboy_http_req to save useful protocol information
* cowboy_http_protocol now defines 'websocket_version' as metadata.
* cowboy_http_rest now defines 'media_type', 'language', 'charset' as metadata.
2011-12-19 09:44:47 +01:00
Loïc Hoguin
f9bd5d1061 Add missing p_headers and cookies to compacted values 2011-12-19 08:56:48 +01:00
Loïc Hoguin
740931131b Merge branch 'resp-body-fix' of github.com:klaar/cowboy 2011-12-17 13:24:54 +01:00
Magnus Klaar
fed1410b14 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.
2011-12-16 16:29:13 +01:00
Loïc Hoguin
621411350a Remove -Wbehaviours dialyzer option unavailable in R15B 2011-12-16 01:26:19 +01:00
Loïc Hoguin
a7a6faf91e Skip dependencies when running ct tests 2011-12-15 20:47:08 +01:00
Loïc Hoguin
ce7084aa07 Fix a dialyzer warning 2011-12-15 20:45:12 +01:00
Loïc Hoguin
f81cb89b54 Reply status 400 if we receive an unexpected value or error for headers 2011-12-15 20:43:15 +01:00
Loïc Hoguin
e550ba7cd3 Add cowboy:accept_ack/1 for a cleaner handling of the shoot message 2011-12-15 20:19:02 +01:00
Loïc Hoguin
874cdd3bda Merge branch 'variances-fix' of github.com:klaar/cowboy 2011-12-12 08:23:34 +01:00
Loïc Hoguin
f445f16f60 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.
2011-12-12 08:21:18 +01:00
Loïc Hoguin
a37dd714e0 Merge branch 'hipe-compilation-fix' of github.com:klaar/cowboy 2011-12-12 07:54:56 +01:00
Loïc Hoguin
7c1372df20 Merge branch 'master' of github.com:talentdeficit/cowboy 2011-12-12 07:47:08 +01:00
alisdair sullivan
62bdb7d9a2 adds webmachine format content type handling 2011-12-12 07:46:35 +01:00
Loïc Hoguin
57eb99fa42 Merge branch 'urlencode' of github.com:klaar/cowboy 2011-12-12 07:20:23 +01:00
Magnus Klaar
2644a6cacc 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.
2011-12-11 19:57:07 +01:00
Magnus Klaar
b1bbd023c5 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.
2011-12-10 18:33:09 +01:00
Magnus Klaar
ef7b41c8ce 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.
2011-12-09 21:38:04 +01:00
Loïc Hoguin
168405830d Fix the process_post/2 function in cowboy_http_rest 2011-12-08 20:21:50 +01:00
Loïc Hoguin
81fe0592b1 Add more documentation to the REST protocol handler 2011-12-08 20:16:04 +01:00
Loïc Hoguin
cc44a6a518 Merge branch 'master' of https://github.com/erlyvideo/cowboy
Just fixed the indentation a bit.
2011-12-08 19:09:05 +01:00
Loïc Hoguin
1530d45f8e Add default values to known_methods and allowed_methods
Only allowing HEAD and GET requests by default.
2011-12-08 18:54:20 +01:00