From 3f4884ca5da9bed7a36daa892564d4fc4de3a8b8 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Sun, 6 Jun 2021 18:56:40 -0700 Subject: [PATCH] v2.21.0 and try github actions --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 11 ----------- CHANGES.md | 7 +++++++ README.md | 3 ++- src/mochiweb.app.src | 2 +- src/mochiweb_util.erl | 8 +++++++- 6 files changed, 59 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d385746e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +on: + push: + branches: + - main + pull_request: +jobs: + test: + name: test + runs-on: ${{matrix.os}} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + otp: + - "24.0.2" + - "23.3.1" + - "22.3.4.9" + - "21.3.8.17" + - "20.3.8.26" + include: + - os: ubuntu-18.04 + otp: "21.2.7" + - os: ubuntu-18.04 + otp: "19.3.6.13" + - os: ubuntu-18.04 + otp: "18.3.4.11" + - os: ubuntu-18.04 + otp: "16.b.2.basho10" + steps: + - uses: actions/checkout@v2.3.2 + - run: | + VERSION=${{matrix.otp}} + RELEASE=$(lsb_release -cs) + DIR=$(mktemp -d) + pushd $DIR + FILE=esl-erlang_$VERSION-1~ubuntu~$RELEASE\_amd64.deb + wget https://packages.erlang-solutions.com/erlang/debian/pool/$FILE + sudo dpkg -i $FILE + popd + rm -r $DIR + - run: make test diff --git a/.travis.yml b/.travis.yml index b1cfa148..00984a83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,19 +2,8 @@ sudo: false language: erlang notifications: email: false -otp_release: - - 23.0 - - 22.0 - - 21.3 - - 21.2.3 - - 21.1 - - 21.0 - - 20.0 - - 19.0 matrix: include: - - otp_release: 18.3 - dist: trusty - otp_release: 17.5 dist: trusty - otp_release: R16B03-1 diff --git a/CHANGES.md b/CHANGES.md index 99fa5253..65e171c6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,10 @@ +Version 2.21.0 released 2021-06-06 + +* Upgrade crypto functions to support OTP 23 + https://github.com/mochi/mochiweb/pull/231 +* Switch from Travis to GitHub Actions for testing + https://github.com/mochi/mochiweb/pull/232 + Version 2.20.1 released 2020-02-03 * Removed deprecated metadata from .app file diff --git a/README.md b/README.md index dcd96f8c..e1e10403 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ To create a new mochiweb using project in a specific directory: 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. +MochiWeb is currently tested with Erlang/OTP 18.3 through 24.0, +but may still be compatible back to R15B-03. # OTP 21.2, 21.2.1, 21.2.2 warning diff --git a/src/mochiweb.app.src b/src/mochiweb.app.src index f8d30b47..7b9578b3 100644 --- a/src/mochiweb.app.src +++ b/src/mochiweb.app.src @@ -1,7 +1,7 @@ %% This is generated from src/mochiweb.app.src {application, mochiweb, [{description, "MochiMedia Web Server"}, - {vsn, "2.20.1"}, + {vsn, "2.21.0"}, {modules, []}, {registered, []}, {env, []}, diff --git a/src/mochiweb_util.erl b/src/mochiweb_util.erl index dde29625..5af2b241 100644 --- a/src/mochiweb_util.erl +++ b/src/mochiweb_util.erl @@ -356,6 +356,12 @@ urlsplit_query("#" ++ Rest, Acc) -> urlsplit_query([C | Rest], Acc) -> urlsplit_query(Rest, [C | Acc]). +extension(Name) -> + case filename:extension(Name) of + "" -> Name; + Ext -> Ext + end. + %% @spec guess_mime(string()) -> string() %% @doc Guess the mime type of a file by the extension of its filename. guess_mime(File) -> @@ -363,7 +369,7 @@ guess_mime(File) -> "crossdomain.xml" -> "text/x-cross-domain-policy"; Name -> - case mochiweb_mime:from_extension(filename:extension(Name)) of + case mochiweb_mime:from_extension(extension(Name)) of undefined -> "text/plain"; Mime ->