Skip to content

Commit fb7bc69

Browse files
committed
OTP 20-22 compliance
A replica of github.com/martinsumner/mochiweb
1 parent f22e7c3 commit fb7bc69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3515
-3315
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010
*.swp
1111
*.beam
1212
*.dump
13+
_build/
14+
rebar.lock

CHANGES.md

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,90 @@
1+
Version 2.20.0 released 2019-07-14
2+
3+
* Expand testing matrix to include Erlang/OTP 22.0 and Erlang/OTP 21.3
4+
* Add support for SameSite=none in cookies
5+
https://github.com/mochi/mochiweb/pull/225
6+
* Fix parsing of certain unquoted cookie values
7+
https://github.com/mochi/mochiweb/pull/212
8+
9+
Version 2.19.0 released 2019-01-17
10+
11+
* Fix warning in 21.2.3 and crash on incompatible releases
12+
(21.2, 21.2.1, 21.2.2 have a SSL bug)
13+
https://github.com/mochi/mochiweb/pull/210
14+
* Erlang/OTP 21 compatibility
15+
https://github.com/mochi/mochiweb/pull/198
16+
https://github.com/mochi/mochiweb/pull/204
17+
* New `{buffer, Buffer}` socket server option
18+
https://github.com/mochi/mochiweb/pull/208
19+
* New `{format, map}` option for mochijson2:decode/2
20+
https://github.com/mochi/mochiweb/pull/206
21+
* No longer crash when a socket is closed server-side
22+
https://github.com/mochi/mochiweb/pull/205
23+
* Support for SameSite cookie setting
24+
https://github.com/mochi/mochiweb/pull/203
25+
26+
Version 2.18.0 released 2018-05-12
27+
28+
* Add the 100.64.0.0/10 private IP shared address range
29+
https://github.com/mochi/mochiweb/pull/193
30+
31+
Version 2.17.0 released 2017-08-12
32+
33+
* Fix deprecation warnings for Erlang/OTP 20.0
34+
https://github.com/mochi/mochiweb/pull/186
35+
* Updated mochiweb_html singleton tag heuristic for HTML5
36+
https://github.com/mochi/mochiweb/pull/190
37+
* Send 400 Bad Request if request line exceeds recbuf (regression fix)
38+
https://github.com/mochi/mochiweb/pull/191
39+
40+
Version 2.16.0 released 2016-12-19
41+
42+
* Added support for encoding maps to mochijson2 (where available)
43+
https://github.com/mochi/mochiweb/pull/184
44+
* Added missing RFC1918 address spaces to the allowed x-forwarded-for header
45+
https://github.com/mochi/mochiweb/pull/183
46+
47+
Version 2.15.1 released 2016-06-24
48+
49+
* Fixed deprecation warnings in Erlang/OTP 19.0
50+
https://github.com/mochi/mochiweb/pull/177
51+
52+
Version 2.15.0 released 2016-05-08
53+
54+
* mochiweb_request now normalizes paths such that duplicate slashes are
55+
discarded (and thus all path segments except the last are non-empty).
56+
https://github.com/mochi/mochiweb/pull/173
57+
58+
Version 2.14.0 released 2016-04-11
59+
60+
* mochiweb_html now requires a letter to begin a HTML tag
61+
https://github.com/mochi/mochiweb/pull/171
62+
63+
Version 2.13.2 released 2016-03-18
64+
65+
* Allow mochijson2 to handle code points that xmerl_ucs considered
66+
invalid
67+
https://github.com/mochi/mochiweb/issues/168
68+
69+
Version 2.13.1 released 2016-03-13
70+
71+
* Fix mochiweb_html regression parsing invalid charref sequences
72+
https://github.com/mochi/mochiweb/issues/167
73+
74+
Version 2.13.0 released 2016-02-08
75+
76+
* Support parsing of UTF-16 surrogate pairs encoded as character
77+
references in mochiweb_html
78+
https://github.com/mochi/mochiweb/issues/164
79+
* Avoid swallowing messages that are not related to the socket
80+
during request parsing
81+
https://github.com/mochi/mochiweb/pull/161
82+
* Ensure correct ordering of Set-Cookie headers: first in, first out
83+
https://github.com/mochi/mochiweb/issues/162
84+
* Improve response times by caching a formatted date once per second
85+
for the response headers with a mochiweb_clock service
86+
https://github.com/mochi/mochiweb/pull/158
87+
188
Version 2.12.2 released 2015-02-21
289

390
* Close connections quietly when setopts fails with a closed socket.
@@ -100,7 +187,7 @@ Version 2.7.0 released 2013-08-01
100187
call instead of an asynchronous cast
101188
* `mochiweb_html:parse_tokens/1` (and `parse/1`) will now create a
102189
html element to wrap documents that have a HTML5 doctype
103-
(`<!doctype html>`) but no html element
190+
(`<!doctype html>`) but no html element
104191
https://github.com/mochi/mochiweb/issues/110
105192

106193
Version 2.6.0 released 2013-04-15
@@ -119,7 +206,7 @@ Version 2.5.0 released 2013-03-04
119206
(URL and Filename safe alphabet, see RFC 4648).
120207
* Fix rebar.config in mochiwebapp_skel to use {branch, "master"}
121208
https://github.com/mochi/mochiweb/issues/105
122-
209+
123210
Version 2.4.2 released 2013-02-05
124211

125212
* Fixed issue in mochiweb_response introduced in v2.4.0

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PREFIX:=../
22
DEST:=$(PREFIX)$(PROJECT)
33

4-
REBAR=./rebar
4+
REBAR=./rebar3
55

66
.PHONY: all edoc test clean build_plt dialyzer app
77

@@ -20,4 +20,5 @@ clean:
2020
@$(REBAR) clean
2121

2222
app:
23+
@[ -z "$(PROJECT)" ] && echo "ERROR: required variable PROJECT missing" 1>&2 && exit 1 || true
2324
@$(REBAR) -r create template=mochiwebapp dest=$(DEST) appid=$(PROJECT)

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
MochiWeb is an Erlang library for building lightweight HTTP servers.
22

3-
[![Build Status](https://secure.travis-ci.org/basho/mochiweb.png?branch=master)](http://travis-ci.org/basho/mochiweb)
3+
The latest version of MochiWeb is available at https://github.com/mochi/mochiweb
44

5-
The latest version of MochiWeb is available at http://github.com/mochi/mochiweb
5+
The mailing list for MochiWeb is at https://groups.google.com/group/mochiweb/
66

7-
The mailing list for MochiWeb is at http://groups.google.com/group/mochiweb/
8-
9-
R12B compatibility:
10-
The master of MochiWeb is tested with R14A and later. A branch compatible
11-
with R12B is maintained separately at http://github.com/lemenkov/mochiweb
12-
The R12B branch of that repository is mirrored in the official repository
13-
occasionally for convenience.
7+
Erlang OTP is required for setting up the MochiWeb environment and is available at https://www.erlang.org/
148

159
To create a new mochiweb using project:
1610
make app PROJECT=project_name
1711

1812
To create a new mochiweb using project in a specific directory:
1913
make app PROJECT=project_name PREFIX=$HOME/projects/
14+
15+
Information about Rebar (Erlang build tool) is available at https://github.com/rebar/rebar
16+
17+
MochiWeb is currently tested with Erlang/OTP R15B03 through 22.0.
18+
19+
# OTP 21.2, 21.2.1, 21.2.2 warning
20+
21+
OTP 21.2 (up to and including 21.2.2) introduced an SSL regression that
22+
makes these releases unsafe to use. See [ERL-830](https://bugs.erlang.org/browse/ERL-830).
23+
This issue was resolved in OTP 21.2.3.

ebin/.hg_empty_dir

Whitespace-only changes.

examples/hmac_api/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ authorize/request/1 should be called in the loop of project_name_web.erl as per:
159159
loop(Req, DocRoot) ->
160160
Auth = hmac_api_lib:authorize_request(Req),
161161
io:format("Auth is ~p~n", [Auth]),
162-
"/" ++ Path = Req:get(path),
162+
"/" ++ Path = mochiweb_request:get(path, Req),
163163
...
164164

165165
When this is done you are ready to test the api:

0 commit comments

Comments
 (0)