diff --git a/.gitignore b/.gitignore index fe54d7e..1cdeaab 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ npm-debug.log node_modules/ .env data/ +certs/ diff --git a/CHANGELOG.md b/CHANGELOG.md index beaffb9..2df1b2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project follows [Semantic Versioning](http://semver.org/). ## [Unreleased][unreleased] +### Changed +- Redirect to HTTPS on heroku + +### Added +- SSL certificate for openerz.metaodi.ch to enable HTTPS ## 4.0.0 - 2020-11-08 ### Changed diff --git a/README.md b/README.md index 0915238..b696e80 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -[![Build Status](https://travis-ci.org/metaodi/openerz.svg?branch=master)](https://travis-ci.org/metaodi/openerz) +[![Build Status](https://github.com/metaodi/openerz/workflows/Build%20OpenERZ/badge.svg)](https://github.com/metaodi/openerz/actions?query=workflow%3A%22Build+OpenERZ%22) -**Access the public API here: http://openerz.metaodi.ch** +**Access the public API here: https://openerz.metaodi.ch** Installation ============ @@ -45,4 +45,4 @@ Credits The logo was created by sagit milshtein from the Noun Project (CC-BY 3.0) -OpenERZ-Logo +OpenERZ-Logo diff --git a/lib/route.js b/lib/route.js index 19599b7..e919985 100644 --- a/lib/route.js +++ b/lib/route.js @@ -118,7 +118,11 @@ function addApiDocRoutes(server) { function redirectToDocs() { return function(request, h) { var protocol = 'http'; + var host = request.headers.host; + if ('openerz.metaodi.ch' === host) { + protocol = 'https'; + } return h.redirect(protocol + '://' + host + '/documentation'); }; }