Age | Commit message (Collapse) | Author |
|
It is now possible to stream one or more sendfile tuples.
A simple example of what can now be done would be for
example to build a tar file on the fly using the sendfile
syscall for sending the files, or to support Range requests
with more than one range with the sendfile syscall.
When using cowboy_compress_h unfortunately we have to read
the file in order to send it. More options will be added
at a later time to make sure users don't read too much
into memory. This is a new feature however so existing
code is not affected.
Also rework cowboy_http's data sending to be flatter.
|
|
This is currently undocumented but is planned to be documented
in the next version.
|
|
|
|
|
|
Depend on Ranch master for now since it isn't in any release yet.
|
|
|
|
|
|
I will test it on a private project before settling on it.
|
|
|
|
Using the current draft:
https://tools.ietf.org/html/draft-ietf-httpbis-h2-websockets-01
|
|
|
|
|
|
Support for these was broken during the development
of Cowboy 2.0. It is now fixed and better handled
than it ever was.
|
|
|
|
This depends on changes in Cowlib that are only available on
master.
|
|
User code can now send as many 1xx responses as necessary.
|
|
To obtain the local socket ip/port and the client TLS
certificate, respectively.
|
|
I have amended a lot of changes from the original commit
to make it behave as expected, including returning a 400
error. LH
|
|
|
|
The documentation was correct, the code was not.
This should make it easier to implement new protocols. Note that
for HTTP/2 we will need to add some form of counting later on to
check for malformed requests, but we can do simpler and just
reduce from the expected length and then check if that's 0 when
IsFin=fin.
|
|
When the request process exits with a {request_error, Reason, Human}
exit reason, Cowboy will return a 400 status code instead of 500.
Cowboy may also return a more specific status code depending on
the error. Currently it may also return 408 or 413.
This should prove to be more solid that looking inside the stack
trace.
|
|
The header never reaches this point.
|
|
|
|
This will result in no data being sent. It's simply easier to
do this than to have to handle 0 size cases in user code.
|
|
|
|
|
|
There are two important changes in this commit.
Constraints are now producing an error tuple. This error tuple
in turn can be provided to a function for formatting a human
readable error message. Both the error tuple and the formatting
code are controlled by and part of the constraint function.
Constraints now also implement the reverse operation.
When constraint functions only validate, the reverse operation
will be the same as the forward operation. When they also do
some conversion then the reverse operation will reverse it.
Since constraints are now performing 3 different operations
(forward, reverse and format_error), they now take the form
of a function accepting two separate arguments. The operation
is the first argument.
In addition, the return value was changed to take the form
of {ok, Value} | {error, Reason}. The value must be returned
as-is if it was not modified.
|
|
|
|
Existing tests pass. A number of things remain to be done.
Has only been tested with Gun so far. Feedback welcome!
|
|
|
|
Maps make more sense because the keys are unique.
|
|
The Opts value is put last, to be more consistent with the
rest of the cowboy_req module.
Additionally a test handler was fixed which reduced the number
of errors in http_SUITE.
|
|
The API will be more consistent like this, and we can ensure
that duplicate cookie names are never sent.
|
|
One had the todo text fixed, another had the task to do done.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Now named read_part/read_part_body, with a verb indicating action.
|
|
|
|
This is a large commit. The cowboy_req interface has largely
changed, and will change a little more. It's possible that
some examples or tests have not been converted to the new
interface yet. The documentation has not yet been updated.
All of this will be fixed in smaller subsequent commits.
Gotta start somewhere...
|
|
|
|
|
|
|
|
|
|
|