Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
We know this specific parameter is case insensitive so we
automatically lowercase it to make things simpler to the
developer.
|
|
The SPDY connection processes are also supervisors.
Missing:
* sendfile support
* request body reading support
|
|
|
|
|
|
|
|
Adds a new type of streaming response fun. It can be set in a similar
way to a streaming body fun with known length:
Req2 = cowboy_req:set_resp_body_fun(chunked, StreamFun, Req)
The fun, StreamFun, should accept a fun as its single argument. This
fun, ChunkFun, is used to send chunks of iodata:
ok = ChunkFun(IoData)
ChunkFun should not be called with an empty binary or iolist as this
will cause HTTP 1.1 clients to believe the stream is over. The final (0
length) chunk will be sent automatically - even if it has already been
sent - assuming no exception is raised.
Also note that the connection will close after the last chunk for HTTP
1.0 clients.
|
|
|
|
|
|
|
|
|
|
Previously http_SUITE:echo_body/1 and http_SUITE:check_raw_status/1
returned large values. Common test would then try to write these to the
logs causing tests to take a long time and use lots of memory.
|
|
|
|
|
|
|
|
|
|
We now have the suite specific modules in the data folder.
Compilation is performed by the Makefile instead of ct_run.
|
|
It defaults to setting the Allow header to "HEAD, GET, OPTIONS".
|
|
|
|
|
|
Instead it will always go through content_types_accepted and it is
up to the resource code to do any creation and to return the created
path if the method is POST and the client should be redirected to the
created resource's location.
This removes the meta value 'put_path' as it is not needed anymore.
This fixes an issue with PATCH where content types were not normalized.
|
|
|
|
For get_type_provided:
'*' will be match any parameters of media-range in "accept" header.
If '*' matched, then '*' is replaced by the matching parameters.
If Accept header is missing and '*' using, then in media_type in parameters
will be '*' and reply content-type will be without any parameters.
For content_types_accepted:
'*' will be match any parameters in "content-type" header.
|
|
|
|
|
|
|
|
We now read from the socket to be able to detect errors or TCP close
events, and buffer the data if any. Once the data receive goes over
a certain limit, which defaults to 5000 bytes, we simply close the
connection with an {error, overflow} reason.
|
|
Conflicts:
src/cowboy_rest.erl
|
|
|
|
|
|
|
|
|
|
Ultimately few things change, it's mostly just a nicer syntax and
slightly different expectations. The name of the value `dispatch`
did not change, because the previous dispatch values will now fail
if the code is not updated to using `cowboy_router:compile/1`.
No constraints have been implemented in this commit.
|
|
|
|
This should have been done a *long* time ago, back when I initially
added Websocket support. This is the first part of two in improving
loop handler support with regards to socket closure.
Reason may include: {normal, shutdown} for the most normal shutdown,
{normal, timeout} for a loop handler timeout shutdown, or {error, _}
if an error occured.
|
|
|
|
Reported and fixed over email by Adrian Roe.
|
|
This makes it similar to the other has_* functions.
|
|
We now always send a failure reason (bad protocol, bad encoding, etc.)
unless the closure was initiated by the client and it didn't send a
close code.
We now check that the close frames have a payload that is valid UTF-8,
unless they don't have a payload at all.
We now do not crash the process anymore when bad opcodes are sent, or
when the opcode 0 is sent before fragmentation was initiated.
Overall this makes us closer to full compliance with the RFC.
|
|
The autobahntestsuite now passes 100% of the tests. We are
getting close to fully implementing the Websocket RFC.
|
|
Good in theory, but implementations may vary. If something stops
working after this commit we might need some tweaks to support
existing clients.
Please try it and give feedback.
|
|
It was only used by Safari 5.0.1 and possibly 5.1. Their market share
is dropping as we speak. It was also insecure (disabled in Firefox
for that reason).
This will allow us to make much more efficient and cleaner code for
the rest of the Websocket versions we support (drafts 7 to 17 + RFC),
which are pretty much all versions seen in the wild excluding the
one we're removing here.
|
|
Also small mostly insignificant changes to tests.
|
|
This behavior can be enabled with the `compress` protocol option.
See the `compress_response` example for more details.
All tests are now ran with and without compression for both HTTP
and HTTPS.
|
|
This changes the behavior of the `timeout` protocol option to
mean "Time in which the full request line and headers must be
received". The default of 5s should be fine for all normal uses.
This change has no noticeable impact on performance and is thus
enabled by default for everyone. It can be disabled by setting
`timeout` to `infinity` although that is definitely not encouraged.
Inspired by the contribution from @naryl on github.
|
|
This allows streaming a body without knowing the length in advance.
Also allows {stream, StreamFun} response body in the REST code.
|
|
|
|
Before we were required to get the socket and transport ourselves,
now they're passed to the function.
|