Bob Ippolito [Tue, 12 Mar 2019 01:32:24 +0000 (01:32 +0000)]
Remove compile(tuple_calls) from test/mochiweb_tests
Bob Ippolito [Tue, 12 Mar 2019 01:32:14 +0000 (01:32 +0000)]
Remove compile(tuple_calls) from test/mochiweb_websocket_tests
Bob Ippolito [Tue, 12 Mar 2019 01:26:08 +0000 (01:26 +0000)]
Remove compile(tuple_calls) from test/mochiweb_http_tests
Bob Ippolito [Mon, 11 Mar 2019 22:57:58 +0000 (22:57 +0000)]
Remove compile(tuple_calls) from examples/keepalive
Bob Ippolito [Mon, 11 Mar 2019 22:55:44 +0000 (22:55 +0000)]
Remove compile(tuple_calls) from examples/https_store
Bob Ippolito [Mon, 11 Mar 2019 22:51:02 +0000 (22:51 +0000)]
Remove compile(tuple_calls) from examples/hmac_api
Bob Ippolito [Mon, 11 Mar 2019 22:45:20 +0000 (22:45 +0000)]
Remove compile(tuple_calls) from the template
Bob Ippolito [Sat, 9 Mar 2019 21:00:29 +0000 (21:00 +0000)]
Remove compile(tuple_calls) from mochiweb_websocket
Bob Ippolito [Sat, 9 Mar 2019 20:53:33 +0000 (20:53 +0000)]
Remove compile(tuple_calls) from mochiweb_response
Bob Ippolito [Sat, 9 Mar 2019 20:50:54 +0000 (20:50 +0000)]
Remove compile(tuple_calls) from mochiweb_request
Bob Ippolito [Sat, 9 Mar 2019 20:47:44 +0000 (20:47 +0000)]
Remove compile(tuple_calls) from mochiweb_multipart
Bob Ippolito [Sat, 9 Mar 2019 20:43:12 +0000 (20:43 +0000)]
Remove compile(tuple_calls) from mochiweb_http
Bob Ippolito [Sat, 9 Mar 2019 20:38:37 +0000 (20:38 +0000)]
Remove compile(tuple_calls) from mochiweb_acceptor
Bob Ippolito [Sat, 9 Mar 2019 20:28:47 +0000 (20:28 +0000)]
Remove compile(tuple_calls) from mochifmt
Bob Ippolito [Mon, 4 Mar 2019 16:55:44 +0000 (08:55 -0800)]
Merge pull request #213 from mochi/lego12239-master
fix cookie value parsing (follow up)
Bob Ippolito [Mon, 4 Mar 2019 16:45:59 +0000 (16:45 +0000)]
Use more direct translation of RFC 6265 grammar
Oleg Nemanov [Mon, 4 Mar 2019 12:24:50 +0000 (15:24 +0300)]
fix cookie value parsing
Cookie value(according to RFC6265) can contain US-ASCII characters
excluding CTLs, whitespace, DQUOTE, comma, semicolon and backslash:
cookie-header = "Cookie:" OWS cookie-string OWS
cookie-string = cookie-pair *( ";" SP cookie-pair )
cookie-pair = cookie-name "=" cookie-value
cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
But mochiweb_cookie:parse_cookie() use smaller allowed characters list.
For example, if cookie value is base64 string like MQ==,
then parse_cookie() makes it MQ.
Fix this by using a separate function for value parsing instead of
read_token().
Bob Ippolito [Thu, 17 Jan 2019 18:01:02 +0000 (18:01 +0000)]
Add missing issue URL to CHANGES.md
Bob Ippolito [Thu, 17 Jan 2019 17:57:12 +0000 (09:57 -0800)]
Merge pull request #210 from mochi/otp-21.2
Add 21.1 and 21.2.3 to otp_release matrix
Bob Ippolito [Thu, 17 Jan 2019 17:56:51 +0000 (17:56 +0000)]
Update CHANGES.md with release date
Bob Ippolito [Wed, 16 Jan 2019 17:50:30 +0000 (09:50 -0800)]
Note this PR. Still have to wait a day for Travis-CI to have this build available
Bob Ippolito [Wed, 16 Jan 2019 17:38:25 +0000 (09:38 -0800)]
Confirmed that 21.2.3 is compatible
Bob Ippolito [Tue, 15 Jan 2019 23:18:11 +0000 (15:18 -0800)]
Update vsn and CHANGES in prep for a release (waiting for an OTP maint release that fixes SSL)
Bob Ippolito [Tue, 15 Jan 2019 23:14:16 +0000 (15:14 -0800)]
Update README.md
Bob Ippolito [Tue, 15 Jan 2019 23:08:21 +0000 (15:08 -0800)]
Add a runtime SSL compatibility check for OTP 21 releases
Bob Ippolito [Thu, 10 Jan 2019 20:16:29 +0000 (12:16 -0800)]
Conditional ssl:handshake/2
Bob Ippolito [Thu, 10 Jan 2019 20:09:24 +0000 (12:09 -0800)]
Use ssl:handshake/2 unconditionally to see when it is first available
Bob Ippolito [Thu, 10 Jan 2019 19:58:57 +0000 (11:58 -0800)]
Add 21.1 and 21.2 to otp_release matrix
Bob Ippolito [Tue, 18 Dec 2018 00:18:27 +0000 (16:18 -0800)]
Merge pull request #208 from nickva/add-buffer-setting
Allow setting {buffer, Buffer} socket server option
Nick Vatamaniuc [Thu, 13 Dec 2018 22:48:08 +0000 (17:48 -0500)]
Allow setting {buffer, Buffer} socket server option
If `recbuf` is `undefined` then buffer size is set explicitly to the
previous `recbuf` default of 8192.
The recent option `{recbuf, undefined}` to allow sockets to pick up optimal OS
default kernel buffer sizes inadvertently reset Erlang's userland buffer size
to a default value of 1460. This buffer size, due to a longstanding bug in
Erlang http parser, limits the maximum URL line that can be parsed by the
{packet, http} socket option, and so breaks existing code.
For example this shows how recbuf also sets buffer size:
```
> f(), SockInfo = fun(S) -> inet:getopts(S, [recbuf, buffer]) end, {ok, LS} = gen_tcp:listen(0, [{recbuf, 8192}]), LRes = SockInfo(LS).
{ok,[{recbuf,8192},{buffer,8192}]}
```
Not setting recbuf resets buffer size to 1460:
```
f(), SockInfo = fun(S) -> inet:getopts(S, [recbuf, buffer]) end, {ok, LS} = gen_tcp:listen(0, []), LRes = SockInfo(LS).
{ok,[{recbuf,131072},{buffer,1460}]}
```
References:
https://github.com/apache/couchdb/issues/1810
http://erlang.org/pipermail/erlang-questions/2011-June/059571.html
http://erlang.org/doc/man/inet.html#setopts-2
Bob Ippolito [Mon, 3 Dec 2018 19:06:20 +0000 (11:06 -0800)]
Merge pull request #206 from lego12239/master
add map support for mochijson2:decode/2
Oleg Nemanov [Fri, 30 Nov 2018 11:37:53 +0000 (14:37 +0300)]
add map support for mochijson2:decode/2
Option {format, map} switch output to map.
Bob Ippolito [Wed, 26 Sep 2018 20:33:30 +0000 (16:33 -0400)]
Merge pull request #205 from choptastic/exit_if_inval
Don't crash if a socket is closed server side
Jesse Gumm [Wed, 26 Sep 2018 20:19:33 +0000 (15:19 -0500)]
Don't crash of a socket is closed server side
If for some reason, the programmer decides to close the socket server side,
the return value for setopts on the socket is {error, einval} rather than
{error, closed}. This change accepts that and suppresses the error message
generated.
Bob Ippolito [Wed, 26 Sep 2018 00:18:00 +0000 (20:18 -0400)]
Merge pull request #204 from nickva/fix-erlang-21-compatibility
Fix Erlang 21 compatibility
Nick Vatamaniuc [Tue, 25 Sep 2018 21:25:27 +0000 (17:25 -0400)]
Fix Erlang 21 compatibility
Robert Newson [Sat, 22 Sep 2018 15:00:46 +0000 (16:00 +0100)]
Add support for SameSite cookie setting (#203)
Ref: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02
Benoit Chesneau [Tue, 24 Jul 2018 04:56:52 +0000 (06:56 +0200)]
add OTP 21 to CI
Benoit Chesneau [Tue, 24 Jul 2018 04:50:30 +0000 (06:50 +0200)]
Merge pull request #198 from gdamjan/master
add tuple_calls compiler flag for erlang 21
Дамјан Георгиевски [Mon, 25 Jun 2018 11:59:57 +0000 (13:59 +0200)]
add tuple_calls compiler flag for erlang 21
From http://www.erlang.org/news/123 :
* "Tuple calls" have been removed from the run-time system.
http://erlang.org/download/otp_src_21.0.readme
* OTP-14497
For legacy code that need to use parameterized modules
or tuple calls for some other reason, there is a new
compiler option called tuple_calls. When this option is
given, the compiler will generate extra code that
emulates the old behavior for calls where the module is
a variable.
Bob Ippolito [Sat, 12 May 2018 20:27:31 +0000 (20:27 +0000)]
Update CHANGES.md for v2.18.0
GeraldXv [Sat, 12 May 2018 20:10:12 +0000 (04:10 +0800)]
Add the Shared Address Space address range (#193)
* update private ip range
update private ip range
* Add the Shared Address Space address range
Bob Ippolito [Sat, 12 Aug 2017 23:31:36 +0000 (16:31 -0700)]
Merge branch 'master' of github.com:mochi/mochiweb
Bob Ippolito [Sat, 12 Aug 2017 23:31:29 +0000 (16:31 -0700)]
Update CHANGES.md for v2.17.0
Ben Olive [Sat, 12 Aug 2017 23:28:33 +0000 (19:28 -0400)]
Handle missing closing tag for all empty elements (#190)
I got the full list of elements from:
https://developer.mozilla.org/en-US/docs/Glossary/empty_element
Robert Newson [Sat, 12 Aug 2017 23:28:12 +0000 (00:28 +0100)]
Send 400 Bad Request if request line exceeds recbuf (#191)
I broke this back in
61a65fea7d6b1e9f93c4a2c6b96e96dee02bec6e. :/
Bob Ippolito [Sat, 12 Aug 2017 23:27:50 +0000 (16:27 -0700)]
remove remaining export_all
Bob Ippolito [Sat, 12 Aug 2017 23:24:01 +0000 (16:24 -0700)]
Getong erlang 20 fix (#192)
* add 20 compile module option: nowarn_export_all
* crypto:rand_uniform/2 is deprecated and will be removed in a future release; use rand:uniform/1
* add 20
* otp20 cleanup
* remove nowarn_export_all
* correct off by one error in rand_uniform/2
Bob Ippolito [Mon, 19 Dec 2016 18:44:11 +0000 (10:44 -0800)]
v2.16.0
Bob Ippolito [Mon, 19 Dec 2016 18:41:43 +0000 (10:41 -0800)]
Merge branch 'TheProductWorks-map_support_on_json_parsing'
Bob Ippolito [Mon, 19 Dec 2016 18:24:37 +0000 (10:24 -0800)]
Refactor #184 for less redundant code
Bob Ippolito [Mon, 19 Dec 2016 16:13:26 +0000 (08:13 -0800)]
Merge branch 'map_support_on_json_parsing' of git://github.com/TheProductWorks/mochiweb into TheProductWorks-map_support_on_json_parsing
kyletrueex [Sun, 18 Dec 2016 19:00:04 +0000 (14:00 -0500)]
adding the other RFC1918 addresss space to the allowed x-forwarded-for header (#183)
Máté Marjai [Sat, 17 Dec 2016 20:54:21 +0000 (20:54 +0000)]
Added conditional map support for mochijson2:encode.
Bob Ippolito [Fri, 24 Jun 2016 22:02:40 +0000 (15:02 -0700)]
Update CHANGES.md and version to v2.15.1
Bob Ippolito [Fri, 24 Jun 2016 21:49:19 +0000 (14:49 -0700)]
Add Erlang 19.0 to travis test matrix
Umberto Corponi [Fri, 24 Jun 2016 21:45:26 +0000 (23:45 +0200)]
Fix otp19 deprecation (#177)
* Fix warning for deprecated of crypto:rand_bytes/1
Since OTP 19 crypto:rand_bytes/1 has been deprecated
in favour of crypto:strong_rand_bytes/1.
* Fix warning for deprecated of random module
Since OTP 19 random has been deprecated in favour of rand.
Benoit Chesneau [Sat, 18 Jun 2016 17:19:29 +0000 (19:19 +0200)]
Merge pull request #176 from benoitc/master
add metadata for mochiweb
benoitc [Sat, 18 Jun 2016 17:18:08 +0000 (19:18 +0200)]
add metadata for mochiweb
Bob Ippolito [Mon, 9 May 2016 00:10:38 +0000 (17:10 -0700)]
Merge branch 'lego12239-master'
Bob Ippolito [Mon, 9 May 2016 00:10:30 +0000 (17:10 -0700)]
Update CHANGES.md for v2.15.0
Oleg Nemanov [Wed, 27 Apr 2016 10:18:03 +0000 (13:18 +0300)]
Remove duplicate slashes from an uri path.
Now Req:get(path) returns a path without duplicate slashes.
E.g. uri path "//foo///bar////" becomes "/foo/bar/".
Signed-off-by: Oleg Nemanov <lego12239@yandex.ru>
Oleg Nemanov [Wed, 27 Apr 2016 10:15:43 +0000 (13:15 +0300)]
Add normalize_path/1 function to mochiweb_util.
Function removes duplicate slashes from a string supplied as a first function
argument.
Signed-off-by: Oleg Nemanov <lego12239@yandex.ru>
Bob Ippolito [Tue, 12 Apr 2016 02:11:28 +0000 (19:11 -0700)]
v2.14.0
Bob Ippolito [Tue, 12 Apr 2016 02:09:20 +0000 (19:09 -0700)]
Merge branch 'master' of https://github.com/mochi/mochiweb
vvoznesensky [Tue, 12 Apr 2016 02:09:07 +0000 (06:09 +0400)]
mochiweb_html tags must start with a letter (#171)
Bob Ippolito [Fri, 18 Mar 2016 18:56:12 +0000 (14:56 -0400)]
v2.13.2
Bob Ippolito [Fri, 18 Mar 2016 18:53:24 +0000 (14:53 -0400)]
Merge pull request #169 from mochi/mochijson2-utf8-gh168
mochijson2: fix utf8 edge case in #168, use unicode module rather than xmerl_ucs
Bob Ippolito [Fri, 18 Mar 2016 18:27:15 +0000 (11:27 -0700)]
mochijson2: fix utf8 edge case in #168, use unicode module rather than xmerl_ucs, 100% test coverage
Bob Ippolito [Sun, 13 Mar 2016 21:02:14 +0000 (14:02 -0700)]
Update travis config
Bob Ippolito [Sun, 13 Mar 2016 20:57:03 +0000 (13:57 -0700)]
Fix mochiweb_html missing charref error #167
Bob Ippolito [Tue, 9 Feb 2016 02:21:29 +0000 (18:21 -0800)]
Merge pull request #165 from mochi/codepoint-to-bytes-surrogate
Support parsing UTF-16 surrogate pairs in mochiweb_html #164
Bob Ippolito [Tue, 9 Feb 2016 02:17:53 +0000 (18:17 -0800)]
Support parsing UTF-16 surrogate pairs in mochiweb_html #164
Bob Ippolito [Wed, 9 Sep 2015 04:24:59 +0000 (21:24 -0700)]
move bench.sh to the template instead
Bob Ippolito [Wed, 9 Sep 2015 01:42:49 +0000 (18:42 -0700)]
Merge pull request #159 from robertkowalski/bench-mochi
add benchmarking for mochiweb
Bob Ippolito [Wed, 9 Sep 2015 01:41:47 +0000 (18:41 -0700)]
update changelog for #161
Bob Ippolito [Wed, 9 Sep 2015 01:40:26 +0000 (18:40 -0700)]
Merge pull request #161 from cloudant/leave-other-messages
Don't swallow 'other' messages
Robert Newson [Tue, 8 Sep 2015 09:39:48 +0000 (10:39 +0100)]
Don't swallow 'other' messages
Mochiweb handlers that use the message queue can sometimes find that
mochiweb has swallowed messages, causing them to timeout or block for
a reply that will never come.
Bob Ippolito [Mon, 31 Aug 2015 15:30:40 +0000 (08:30 -0700)]
ensure correct ordering of Set-Cookie output headers #162
Bob Ippolito [Mon, 31 Aug 2015 05:55:14 +0000 (22:55 -0700)]
update CHANGELOG for #158
Bob Ippolito [Mon, 31 Aug 2015 01:04:57 +0000 (18:04 -0700)]
Merge pull request #158 from robertkowalski/simplify
performance: cache date
Robert Kowalski [Tue, 4 Aug 2015 20:28:26 +0000 (22:28 +0200)]
_PID -> _Pid
Robert Kowalski [Tue, 4 Aug 2015 20:02:12 +0000 (22:02 +0200)]
remove apply call
Robert Kowalski [Tue, 4 Aug 2015 20:01:43 +0000 (22:01 +0200)]
do not stop clock on http stop
Robert Kowalski [Sat, 1 Aug 2015 21:52:01 +0000 (23:52 +0200)]
don't stablish link
Robert Kowalski [Wed, 29 Jul 2015 22:59:35 +0000 (00:59 +0200)]
apply feedback on starting the clock
Robert Kowalski [Wed, 29 Jul 2015 22:50:12 +0000 (00:50 +0200)]
return string
Robert Kowalski [Wed, 29 Jul 2015 22:36:01 +0000 (00:36 +0200)]
optimize for read concurrency
Robert Kowalski [Tue, 28 Jul 2015 20:40:22 +0000 (22:40 +0200)]
remove detached
not needed
Robert Kowalski [Tue, 28 Jul 2015 20:32:58 +0000 (22:32 +0200)]
remove wrong name from debugging
Robert Kowalski [Mon, 20 Jul 2015 00:46:38 +0000 (02:46 +0200)]
performance: cache date
as the formatting of the date for each request is quite expensive
we cache it in an ets table now.
heavily inspired by cowboy, but does not use binaries and uses
still httpd_util:rfc1183 internally.
Robert Kowalski [Sun, 19 Jul 2015 22:19:12 +0000 (00:19 +0200)]
add benchmarking for mochiweb
Add a benchmark-script, and add `make bench` which creates an app
for the benchmark. Additionally add a new route to the sample app
to have a benchmark that is not dependent on the file system.
Bob Ippolito [Sun, 8 Mar 2015 06:19:56 +0000 (22:19 -0800)]
Merge pull request #155 from jgrnt/export_stream
Export stream_body/5, allows to specify a max body length
Bob Ippolito [Sun, 8 Mar 2015 06:19:28 +0000 (22:19 -0800)]
Merge pull request #154 from jgrnt/allow_recbuf
Allow recbuf to be undefined
Georg Göri [Thu, 5 Mar 2015 22:01:35 +0000 (23:01 +0100)]
Allow recbuf to be undefined
If recbuf option is undefined, the operating system decides on the buffer size
If no buffer size is speciefied, streaming will happen in the chunks of MaxChunkSize
Georg Göri [Fri, 6 Mar 2015 20:42:40 +0000 (21:42 +0100)]
Export stream_body/5, allows to specify a max body length
Bob Ippolito [Sat, 21 Feb 2015 20:04:01 +0000 (12:04 -0800)]
exit when setopts result is {error,closed} #152
Bob Ippolito [Sun, 1 Feb 2015 18:06:08 +0000 (10:06 -0800)]
update CHANGES for v2.12.1
Bob Ippolito [Sun, 1 Feb 2015 18:04:31 +0000 (10:04 -0800)]
Merge pull request #150 from mochi/active-sockets-149
fix active_socket accounting #149
Bob Ippolito [Mon, 26 Jan 2015 06:07:50 +0000 (22:07 -0800)]
attempt to fix active_socket accounting #149