Age | Commit message (Collapse) | Author |
|
|
|
|
|
Use cow_qs:urldecode/1 and cow_qs:urlencode/1 instead
|
|
|
|
tohexu(16) or tohexl(16) will now crash, instead of evaluating to $G or $g.
|
|
* Parsing code was moved to cowlib: cowboy_qs:parse_qs/1
* A function was added to build query strings: cowboy_qs:qs/1
* Also added cowboy_qs:urlencode/1 and cowboy_qsurldecode/1
|
|
The code for parsing has also been rewritten to be more efficient
and to be able to handle cookie values with space inside them properly.
Update cowlib to 0.2.0.
|
|
Previously cowboy_http:te_chunked/2 would enter an incorrect state if
it tried to parse an incomplete chunk when the length was known from the
partial chunk.
Previosuly cowboy_http:te_chunked/2 expected the trailing "\r\n" to
always be present if chunk body was present in the buffer. This is not
guaranteed and so this commit accommodates that situation.
|
|
|
|
We know this specific parameter is case insensitive so we
automatically lowercase it to make things simpler to the
developer.
|
|
|
|
|
|
|
|
Now instead of {1, 1} we have 'HTTP/1.1', and instead of {1, 0}
we have 'HTTP/1.0'. This is more efficient, easier to read in
crash logs, and clearer in the code.
|
|
|
|
|
|
|
|
|
|
This should be more in line with what browsers are doing,
and will prevent errors due to failed expectations.
|
|
Defaults to a maximum of 1000000 bytes.
Also standardize the te_identity and te_chunked decoding functions.
Now they both try to read as much as possible (up to the limit),
making body reading much faster when not using chunked encoding.
|
|
Worked until 27da092
|
|
|
|
|
|
Basic HTTP authorization according to RFC 2617 is implemented.
Added an example of its usage with REST handler.
|
|
|
|
|
|
|
|
This should be equivalent to what we do in Set-Cookie. Real-world
testing is needed to confirm it works as intended.
|
|
No more trying to quote, this is still completely broken everywhere.
|
|
|
|
Includes:
* cowboy_clock:rfc2109/1 now expects UTC datetime
* Rewrite of the cookie code to cowboy_http
* Removal of cowboy_cookies
* Add type cowboy_req:cookie_opts/0
Cookies should now be set using cowboy_req:set_resp_cookie/3.
Code calling cowboy_cookies directly will need to be updated.
|
|
This allows inconsistent behavior and is not used enough to be supported.
|
|
Still optimizing the critical path.
Removes cowboy_http:connection_to_atom/1.
|
|
* #state{} changes are avoided where possible
* #state{} is now smaller and use less memory
* the Req object is created only after the whole request is parsed
* parsing makes use of a single binary match context
* external calls are avoided in the critical path
* URL fragment is now extracted properly (retrieval API next commit)
* argument orders to local functions modified to avoid extra operations
* dispatching waits as long as possible before tokenizing host/path
* handler opts are no longer shown in the error messages except in init
The code may not look as beautiful as it was before. But it really
is, for parsing code. The parsing section of the file may be skipped
if your eyes start to burn.
|
|
Also fix a bug introduced in a previous commit.
|
|
Header names are now binaries. Since header names are case insensitive
they are all converted to lowercase. For example: <<"content-length">>.
The max_line_length option was removed. Three new options have been
added instead:
* max_request_line_length (defaults to 4096)
* max_header_name_length (defaults to 64)
* max_header_value_length (defaults to 4096)
|
|
First step in making all methods and header names binaries to
get rid of many inconsistencies caused by decode_packet/3.
Methods are all binary now. Note that since they are case
sensitive, the usual methods become <<"GET">>, <<"POST">> and so on.
|
|
Originally suggested by Roberto Ostinelli.
|
|
|
|
This should make easier spotting additions and removals in commits.
|
|
Also update the CHANGELOG and copyright years.
|
|
|
|
Use a proper HTTP client to run all tests. This client is currently
undocumented and should not be used.
Includes a few fixes:
* Fix a bug in the max_keepalive test
* Fix a bug with max_keepalive handling
* Fix a bug in stream_body/1 where data was lost under some conditions
The tests now run quite faster than before.
All the tests now run twice: once for TCP, once for SSL.
|
|
Certain user agents send invalid Accept-Charset headers, like the
following: "ISO-8859-1;utf-8;q=0.7,*;q=0.7"
The user agent with which this behavior was observed presented itself
with the User-Agent string: "Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.9) Gecko/2008052906 Firefox/3.0" Although this doesn't
appear to be correct. The request might have been mangled by a
transparent proxy.
|
|
Introduces 3 low level functions and updates the existing higher
levels functions. The new primitives are has_body/1, body_length/1
and stream_body/1. In addition to that, a helper function
init_stream/4 has been added.
Streaming a body implies to decode the Transfer-Encoding and
Content-Encoding used for the body. By default, Cowboy will try
to figure out what was used and decode them properly. You can
override this if you want to disable this behavior or simply
support more encodings by calling the init_stream/4 function
before you start streaming the body.
|
|
Certain user agents send slightly invalid media types, like the
following: "text/html, image/gif, image/jpeg, ; q=.2, */; q=.2"
The user agent with which this behavior was observed presented itself
with the User-Agent string: "Mozilla/5.0 (Macintosh; U; Intel Mac OS X
10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (FlipboardProxy/0.0.5;
+http://flipboard.com/browserproxy)"
|
|
|
|
This was initially an internal function, it has been made public
due to popular demand as it can sometimes be needed.
|
|
At the same time renaming cowboy_http:content_type_params/3 to
cowboy_http:params/2 (with a default Acc of []) as this code isn't
useful only for content types.
|
|
|