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

1539 commits

Author SHA1 Message Date
Loïc Hoguin
aa4d86b81f Remove the onrequest hook
It was redundant with middlewares. Allows us to save a few operations
for every incoming requests.
2014-09-24 14:39:17 +03:00
Loïc Hoguin
25259671f5 Make routing constraints use the fields format
This makes routing more in line with the rest of Cowboy and
allows us to use cowboy_constraints directly.
2014-09-23 21:36:52 +03:00
Loïc Hoguin
f1c3b6d76f Breaking update of the cowboy_req interface
Simplify the interface for most cowboy_req functions. They all return
a single value except the four body reading functions. The reply functions
now only return a Req value.

Access functions do not return a Req anymore.

Functions that used to cache results do not have a cache anymore.

The interface for accessing query string and cookies has therefore
been changed.

There are now three query string functions: qs/1 provides access
to the raw query string value; parse_qs/1 returns the query string
as a list of key/values; match_qs/2 returns a map containing the
values requested in the second argument, after applying constraints
and default value.

Similarly, there are two cookie functions: parse_cookies/1 and
match_cookies/2. More match functions will be added in future commits.

None of the functions return an error tuple anymore. It either works
or crashes. Cowboy will attempt to provide an appropriate status code
in the response of crashed handlers.

As a result, the content decode function has its return value changed
to a simple binary, and the body reading functions only return on success.
2014-09-23 16:43:29 +03:00
Loïc Hoguin
b57f94661f Merge branch 'master' of git://github.com/okeuday/cowboy 2014-08-12 19:01:56 +02:00
Loïc Hoguin
ef0ec79322 Fix incorrect type in cowboy_static manual 2014-08-12 19:01:12 +02:00
Michael Truog
a32a476bf2 Add cowboy_req:part/2 export 2014-08-12 08:31:30 -07:00
Loïc Hoguin
2928456ae8 Merge branch 'patch-1' of git://github.com/asabil/cowboy 2014-08-11 19:25:47 +02:00
Ali Sabil
428653ab36 Fix REST guide reference to accept_missing_post
The guide refers to accept_missing_post instead of allow_missing_post.
2014-08-11 10:58:48 +02:00
Loïc Hoguin
260fc1e60b Handle absolute URIs that lack a path entirely 2014-08-06 11:32:58 +02:00
Loïc Hoguin
3625d6a2e2 Accept absolute URI scheme as uppercase
We should be doing a case insensitive comparison to be correct,
but this is more expensive. Almost all clients send lowercase,
this patch fixes handling of the aws/aws-sdk-php client which
sends uppercase, and no known client sends mixed case so I am
holding back on the more expensive solution for the moment.
2014-08-06 11:15:26 +02:00
Loïc Hoguin
a2fabcdecf Fix language in getting started 2014-08-02 12:55:15 +02:00
Loïc Hoguin
5cf9ac25e5 Update links extend -> ninenines 2014-08-02 12:38:15 +02:00
Loïc Hoguin
ee370accec Fix bad link format in the guide 2014-08-02 12:11:54 +02:00
Loïc Hoguin
021f4f6069 Update Cowboy to 1.0.0 2014-08-01 14:49:02 +02:00
Loïc Hoguin
03d8131f2a Remove 1.0 section in the ROADMAP 2014-08-01 14:43:04 +02:00
Loïc Hoguin
2d6ff3d3a9 Update CHANGELOG 2014-08-01 14:40:33 +02:00
Loïc Hoguin
aaac973cbd Update rebar.config 2014-08-01 14:33:30 +02:00
Loïc Hoguin
55ede9e5a9 Update AUTHORS 2014-08-01 14:31:46 +02:00
Loïc Hoguin
e16d1bafab Add OTP release support and versioning info to the guide 2014-08-01 14:27:30 +02:00
Loïc Hoguin
8d436c4744 Update the Getting started chapter to new erlang.mk
Length of the chapter divided by 2! \o/
2014-08-01 14:27:04 +02:00
Loïc Hoguin
62de3a62f9 Update to erlang.mk 1.0.0 2014-08-01 14:26:51 +02:00
Loïc Hoguin
9e437e8119 Merge branch 'master' of git://github.com/ztmr/cowboy 2014-07-27 16:45:58 +02:00
Tomas Morstein
912d3d3566 fix a documentation typo
The function `set_resp_header' is defined in `cowboy_req'
module, not the `cowboy'.
2014-07-26 12:32:04 +02:00
Loïc Hoguin
99061274b6 Merge branch 'http-1-0-keepalive' of git://github.com/heroku/cowboy 2014-07-17 13:54:29 +02:00
Fred Hebert
b10b34a8f2 Support ad-hoc keep-alive for HTTP/1.0 Clients
Only go for keep-alive if they submit a 'connection: keep-alive' header
in the request, keep behaviour the same otherwise.

The new RFC 7230 (http://tools.ietf.org/html/rfc7230#section-6.3)
states:

    If the received protocol is HTTP/1.0, the "keep-alive" connection
    option is present, the recipient is not a proxy, and the recipient
    wishes to honor the HTTP/1.0 "keep-alive" mechanism, the
    connection will persist after the current response;

Even though clients are discouraged from doing so in Appendix A.1.2
(http://tools.ietf.org/html/rfc7230#appendix-A.1.2)
2014-07-14 10:11:03 -04:00
Loïc Hoguin
9980348a1c Remove deprecated body reading interface 2014-07-12 15:42:45 +02:00
Loïc Hoguin
ecbebeefe8 Remove useless todo comments 2014-07-12 14:50:01 +02:00
Loïc Hoguin
e2b5c21443 Drop R15 support 2014-07-12 14:19:29 +02:00
Loïc Hoguin
de4697690c Small addition to the ROADMAP 2014-07-12 12:11:24 +02:00
Loïc Hoguin
97a3108576 Reply with 400 on header parsing crash
This is a first step to improve the HTTP status codes returned
by Cowboy on crashes. We will tweak it over time.

Also fixes a small bug where two replies may have been sent
when using loop handlers under rare conditions.
2014-07-12 12:09:43 +02:00
Loïc Hoguin
20f598f373 Clarify {true, URL} return for AcceptResource callback 2014-07-10 14:27:11 +02:00
Loïc Hoguin
fd423eb170 Merge branch 'fix-spdy-parse-frame' of git://github.com/voluntas/cowboy
A fix for a possible bug has been made to the original patch.
2014-07-07 17:22:36 +02:00
Loïc Hoguin
7f179f377f Add failing test of chaining SPDY frames 2014-07-07 17:18:14 +02:00
Loïc Hoguin
d38c064f73 Small addition to 2.0 roadmap 2014-07-07 14:14:36 +02:00
Loïc Hoguin
078d686a0a Provide installable man pages
make docs: generate Markdown and man pages in doc/
make install-docs: install man pages to be usable directly

Docs are generated from the ezdoc files in doc/src/.
2014-07-06 13:10:35 +02:00
Loïc Hoguin
1a71a733c3 Add a new guide chapter: designing a resource handler 2014-07-01 14:06:20 +02:00
Loïc Hoguin
993606ede8 Explain that passing Req around leads to undefined behavior 2014-07-01 13:21:24 +02:00
Loïc Hoguin
15da836d2a Merge branch 'fix/rest_principles_typo' of git://github.com/paulo-ferraz-oliveira/cowboy 2014-07-01 09:52:15 +02:00
Paulo Oliveira
531e7f9d7b Fix typo in REST principles chapter 2014-06-30 21:45:11 +01:00
Loïc Hoguin
fdf815bfce Add missing bracket in a guide example 2014-06-30 18:17:34 +02:00
Loïc Hoguin
163f0b5651 Tweak the REST principles chapter following feedback 2014-06-30 18:08:49 +02:00
Loïc Hoguin
e6473ba3ea Add note about httpbis to the roadmap 2014-06-30 17:51:01 +02:00
Loïc Hoguin
4eee573700 Return 422 instead of 400 when AcceptResource returns false
422 is undefined for HTTP and interpreted as 400.
2014-06-30 17:49:36 +02:00
Loïc Hoguin
8cc353114e Update specs that were too wide 2014-06-30 17:36:43 +02:00
Loïc Hoguin
bc3b122e89 Forgot a todo in the ROADMAP 2014-06-30 16:21:27 +02:00
Loïc Hoguin
e40c2c33c5 Roadmap for Cowboy 2.0 2014-06-30 16:07:46 +02:00
Loïc Hoguin
4eb6c7928a Fix typo 2014-06-30 10:18:54 +02:00
Loïc Hoguin
abcc6e96d8 Update erlang.mk and update paths to start the release
Fixes a couple invalid instructions at the same time.
2014-06-30 10:14:05 +02:00
Nakai Ryosuke
fec3355192 Fix cowboy_spdy parse frame 2014-06-28 20:13:41 +09:00
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