Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.21.0 and try github actions #232

Merged
merged 1 commit into from
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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/[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
11 changes: 0 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
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