Skip to content

Commit

Permalink
v2.21.0 and try github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Jun 7, 2021
1 parent 448984c commit d70e2bf
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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"
- os: ubuntu-18.04
otp: "19.3.6.13"
- os: ubuntu-18.04
otp: "18.3.4.11"
steps:
- uses: actions/[email protected]
- 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
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 2.21.0 released 2021-06-06

* Upgrade crypto functions to support OTP 23
https://github.com/mochi/mochiweb/pull/231
* Drop testing for releases prior to OTP 18.3

Version 2.20.1 released 2020-02-03

* Removed deprecated metadata from .app file
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/mochiweb.app.src
Original file line number Diff line number Diff line change
@@ -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, []},
Expand Down
8 changes: 7 additions & 1 deletion src/mochiweb_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,20 @@ 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) ->
case filename:basename(File) of
"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 ->
Expand Down

0 comments on commit d70e2bf

Please sign in to comment.