Skip to content

Commit

Permalink
OTP 20-22 compliance
Browse files Browse the repository at this point in the history
A replica of github.com/martinsumner/mochiweb
  • Loading branch information
martinsumner committed Aug 18, 2020
1 parent f22e7c3 commit fb7bc69
Show file tree
Hide file tree
Showing 58 changed files with 3,515 additions and 3,315 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
*.swp
*.beam
*.dump
_build/
rebar.lock
91 changes: 89 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,90 @@
Version 2.20.0 released 2019-07-14

* Expand testing matrix to include Erlang/OTP 22.0 and Erlang/OTP 21.3
* Add support for SameSite=none in cookies
https://github.com/mochi/mochiweb/pull/225
* Fix parsing of certain unquoted cookie values
https://github.com/mochi/mochiweb/pull/212

Version 2.19.0 released 2019-01-17

* Fix warning in 21.2.3 and crash on incompatible releases
(21.2, 21.2.1, 21.2.2 have a SSL bug)
https://github.com/mochi/mochiweb/pull/210
* Erlang/OTP 21 compatibility
https://github.com/mochi/mochiweb/pull/198
https://github.com/mochi/mochiweb/pull/204
* New `{buffer, Buffer}` socket server option
https://github.com/mochi/mochiweb/pull/208
* New `{format, map}` option for mochijson2:decode/2
https://github.com/mochi/mochiweb/pull/206
* No longer crash when a socket is closed server-side
https://github.com/mochi/mochiweb/pull/205
* Support for SameSite cookie setting
https://github.com/mochi/mochiweb/pull/203

Version 2.18.0 released 2018-05-12

* Add the 100.64.0.0/10 private IP shared address range
https://github.com/mochi/mochiweb/pull/193

Version 2.17.0 released 2017-08-12

* Fix deprecation warnings for Erlang/OTP 20.0
https://github.com/mochi/mochiweb/pull/186
* Updated mochiweb_html singleton tag heuristic for HTML5
https://github.com/mochi/mochiweb/pull/190
* Send 400 Bad Request if request line exceeds recbuf (regression fix)
https://github.com/mochi/mochiweb/pull/191

Version 2.16.0 released 2016-12-19

* Added support for encoding maps to mochijson2 (where available)
https://github.com/mochi/mochiweb/pull/184
* Added missing RFC1918 address spaces to the allowed x-forwarded-for header
https://github.com/mochi/mochiweb/pull/183

Version 2.15.1 released 2016-06-24

* Fixed deprecation warnings in Erlang/OTP 19.0
https://github.com/mochi/mochiweb/pull/177

Version 2.15.0 released 2016-05-08

* mochiweb_request now normalizes paths such that duplicate slashes are
discarded (and thus all path segments except the last are non-empty).
https://github.com/mochi/mochiweb/pull/173

Version 2.14.0 released 2016-04-11

* mochiweb_html now requires a letter to begin a HTML tag
https://github.com/mochi/mochiweb/pull/171

Version 2.13.2 released 2016-03-18

* Allow mochijson2 to handle code points that xmerl_ucs considered
invalid
https://github.com/mochi/mochiweb/issues/168

Version 2.13.1 released 2016-03-13

* Fix mochiweb_html regression parsing invalid charref sequences
https://github.com/mochi/mochiweb/issues/167

Version 2.13.0 released 2016-02-08

* Support parsing of UTF-16 surrogate pairs encoded as character
references in mochiweb_html
https://github.com/mochi/mochiweb/issues/164
* Avoid swallowing messages that are not related to the socket
during request parsing
https://github.com/mochi/mochiweb/pull/161
* Ensure correct ordering of Set-Cookie headers: first in, first out
https://github.com/mochi/mochiweb/issues/162
* Improve response times by caching a formatted date once per second
for the response headers with a mochiweb_clock service
https://github.com/mochi/mochiweb/pull/158

Version 2.12.2 released 2015-02-21

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

Version 2.6.0 released 2013-04-15
Expand All @@ -119,7 +206,7 @@ Version 2.5.0 released 2013-03-04
(URL and Filename safe alphabet, see RFC 4648).
* Fix rebar.config in mochiwebapp_skel to use {branch, "master"}
https://github.com/mochi/mochiweb/issues/105

Version 2.4.2 released 2013-02-05

* Fixed issue in mochiweb_response introduced in v2.4.0
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PREFIX:=../
DEST:=$(PREFIX)$(PROJECT)

REBAR=./rebar
REBAR=./rebar3

.PHONY: all edoc test clean build_plt dialyzer app

Expand All @@ -20,4 +20,5 @@ clean:
@$(REBAR) clean

app:
@[ -z "$(PROJECT)" ] && echo "ERROR: required variable PROJECT missing" 1>&2 && exit 1 || true
@$(REBAR) -r create template=mochiwebapp dest=$(DEST) appid=$(PROJECT)
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
MochiWeb is an Erlang library for building lightweight HTTP servers.

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

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

The mailing list for MochiWeb is at http://groups.google.com/group/mochiweb/

R12B compatibility:
The master of MochiWeb is tested with R14A and later. A branch compatible
with R12B is maintained separately at http://github.com/lemenkov/mochiweb
The R12B branch of that repository is mirrored in the official repository
occasionally for convenience.
Erlang OTP is required for setting up the MochiWeb environment and is available at https://www.erlang.org/

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

To create a new mochiweb using project in a specific directory:
make app PROJECT=project_name PREFIX=$HOME/projects/

Information about Rebar (Erlang build tool) is available at https://github.com/rebar/rebar

MochiWeb is currently tested with Erlang/OTP R15B03 through 22.0.

# OTP 21.2, 21.2.1, 21.2.2 warning

OTP 21.2 (up to and including 21.2.2) introduced an SSL regression that
makes these releases unsafe to use. See [ERL-830](https://bugs.erlang.org/browse/ERL-830).
This issue was resolved in OTP 21.2.3.
Empty file removed ebin/.hg_empty_dir
Empty file.
2 changes: 1 addition & 1 deletion examples/hmac_api/README
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ authorize/request/1 should be called in the loop of project_name_web.erl as per:
loop(Req, DocRoot) ->
Auth = hmac_api_lib:authorize_request(Req),
io:format("Auth is ~p~n", [Auth]),
"/" ++ Path = Req:get(path),
"/" ++ Path = mochiweb_request:get(path, Req),
...

When this is done you are ready to test the api:
Expand Down
Loading

0 comments on commit fb7bc69

Please sign in to comment.