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

743 commits

Author SHA1 Message Date
Gary Rennie
0c15b9216b
Update cowboy version to 1.1.2 in cowboy.app.src 2017-02-06 12:25:58 +01:00
Loïc Hoguin
2a7bb7ba11
Update to 1.1.0 2017-01-31 18:56:07 +01:00
Loïc Hoguin
8441158260
Fix wrong path url decoding algorithm
I embed cow_uri since I can't update Cowlib further easily.
This is most likely a one shot release so it shouldn't be
a problem to do things a little more dirty than usual.
2017-01-31 18:50:32 +01:00
Jean-Sébastien Pédron
98c2bc64e5
cowboy_static: Add support for files in EZ archives
If cowboy_static is initialized with `{priv_file, ...}` or `{priv_dir,
...}`, it is now able to read files from Erlang application .ez
archives.

When serving a file from an archive, the #file_info{} comes from the
archive, not the contained file, except for the size and type. The
erl_prim_loader module is used to read the latter's #file_info{} and the
actual file content (ie. sendfile(2) is not used in this case).

(cherry picked from commit 2166733628)
2017-01-31 16:19:45 +01:00
Loïc Hoguin
c01dadde57 Update version to 1.1.0-dev 2015-11-16 18:12:29 +01:00
Loïc Hoguin
d08c2ab39d Update to 1.0.4 2015-11-16 16:10:43 +01:00
Loïc Hoguin
04eadae381 Fix crash when using IOlists with some Websocket frames
Backported from Cowlib's patch from Rob Ashton <robashton@codeofrob.com>.
2015-11-16 15:58:37 +01:00
Loïc Hoguin
b8e4115eb1 Update Cowboy to 1.0.3 2015-08-07 17:42:48 +02:00
Alexey Lebedeff
8c60dd6c1b Use 'Connection' header only when necessary
Fixes #839 when 'Connection: Keep-Alive' wasn't sent in a HTTP/1.0
response. Now the usage of 'Connection' header is consistent with
current protocol version: when this header is not specified explicitly
in the response, HTTP/1.0 implies 'Connection: close' and HTTP/1.1
implies 'Connection: Keep-Alive'. So if current 'Connection' value
matches the default value of current protocol, we won't state obvious
fact in the response; and vice versa.

Amended to fix and improve tests, and revert the variable name
change from HTTP11Headers to StdHeaders. I think it's still good
to leave it as is because it's not really a standard header for
HTTP/1.0, and it's gone from HTTP/2 entirely.
2015-08-07 15:30:09 +02:00
Loïc Hoguin
19a279dfdc Merge branch 'fix-typo-in-cowboy_http' of https://github.com/mocchira/cowboy into 1.0.x 2015-07-26 22:05:05 +02:00
Loïc Hoguin
9b424fec2b Dialyzer fixes in cowboy_clock
This is what I get for merging blindly!

and

Fix a compile error introduced in previous commit

(cherry-pick)
2015-07-26 18:34:17 +02:00
mocchira
67ab508d9b Fix typo in cowboy_http:asctime_date 2015-07-15 03:26:25 +00:00
Loïc Hoguin
79aa25cc03 Update Cowboy to 1.0.2 2015-07-02 22:00:45 +02:00
Loïc Hoguin
df1b3dcd0e Merge branch 'fix-rest-stacktrace' of https://github.com/danielwhite/cowboy into 1.0.x 2015-07-02 21:56:08 +02:00
Loïc Hoguin
4fb2aacc88 Merge branch 'fix-1' of https://github.com/martinrehfeld/cowboy into 1.0.x 2015-05-06 11:33:27 +03:00
Alex Kovalev
1d99878561 added a comment for non-obvious erlang:cancel_timer 2015-03-26 12:55:42 +03:00
Alex Kovalev
c05143aba8 fixed cowboy_clock inbox overflow if system clock was changed 2015-03-26 11:15:05 +03:00
Daniel White
57671cbbb0 Get stacktrace before executing rest_terminate
At present, the resulting stacktrace will be misleading about where the
underlying error occurred.
2015-03-25 14:23:15 +11:00
Martin Rehfeld
aa2d41951a Only address the specific quoted_string issue 2015-01-30 14:11:13 +00:00
Martin Rehfeld
07ef3c32d7 Reply with 400 on if*-match parsing crash 2015-01-30 13:43:55 +00:00
Loïc Hoguin
3d9078018d Update Cowboy to 1.0.1 2014-11-07 14:43:38 +02:00
Loïc Hoguin
f670562a4a Update erlang.mk
This should fix an issue with DEPS on FreeBSD.
2014-11-07 14:31:25 +02:00
Michael Truog
a32a476bf2 Add cowboy_req:part/2 export 2014-08-12 08:31:30 -07: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
021f4f6069 Update Cowboy to 1.0.0 2014-08-01 14:49:02 +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
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
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
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
Nakai Ryosuke
fec3355192 Fix cowboy_spdy parse frame 2014-06-28 20:13:41 +09:00
Loïc Hoguin
ee3ad5e510 Update Cowboy to 0.10.0 2014-06-10 12:07:11 +02:00
Loïc Hoguin
7cd3ecc6b6 Fix specs and a weird value in cowboy_spdy 2014-06-10 09:24:06 +02:00
Loïc Hoguin
fc7e038fba Merge branch 'binary-expires' of git://github.com/NineFX/cowboy 2014-06-10 08:39:40 +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
5d1d9af6cd Add a return value to onresponse hook to override status/headers
This would allow us to override them without messing up the body,
and would make it usable with the static file handler for example.

Experimental at this point.
2014-06-03 18:31:05 +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
da29d8138d Merge branch 'language-range-header' of git://github.com/NineFX/cowboy 2014-04-26 14:38:24 +02:00
Loïc Hoguin
980342f73c Make loop handlers work with SPDY
Adds a loop_handler test suite that runs all tests under HTTP, HTTPS,
SPDY each with and without the compress option enabled.

Fixes output filtering that used to filter more than it should have.
This forces us to parse the string sent by the emulator, which means
it's probably not perfect yet. But it should at least not hide errors
we want to see.

Fix a crash in the output filtering code that entirely disabled
output. Now when there is a crash the normal tty output is restored.

Handlers are now in test/handlers/ as they can be reused between
suites.

Only generate a single certificate for the whole ct run to speed
things up when we got many different test groups each needing
certificates.
2014-04-26 13:46:55 +02:00
Loïc Hoguin
5c2adc167a Merge branch 'fix/basic-auth-empty-password' of git://github.com/soundrop/cowboy 2014-04-17 13:23:48 +02:00
Loïc Hoguin
0502452967 Update cowlib to 0.6.1 2014-03-27 11:39:09 +01:00
Loïc Hoguin
c9b9644aa3 Add +warn_missing_spec and fix specs 2014-03-27 11:30:44 +01:00
Loïc Hoguin
17af50812c Remove outdated comments, all edoc, plus a few minor tweaks 2014-03-26 19:05:59 +01:00
Loïc Hoguin
abf246c9aa Make the latin1 cyrillic route tests work on R17+
Instead of relying on the encoding of the file we now simply
have list of numbers as they would be inside a latin1 file.
2014-03-25 11:42:57 +01:00
Loïc Hoguin
0c0caa3a47 Don't flush the resp_sent message if connection is closed
Tiny optimization.
2014-03-25 11:06:21 +01:00
Loïc Hoguin
704f61c9d1 Remove cowboy_client; use gun for the HTTP test suite 2014-03-24 14:25:09 +01:00