Skip to content

Commit

Permalink
Switch to HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
metaodi authored and Stefan Oderbolz committed Nov 10, 2020
1 parent 3b832a5 commit 7c156b2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ npm-debug.log
node_modules/
.env
data/
certs/
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
============
Expand Down Expand Up @@ -45,4 +45,4 @@ Credits

The logo was created by sagit milshtein from the Noun Project (CC-BY 3.0)

<img src="http://openerz.metaodi.ch/static/logo.png" alt="OpenERZ-Logo" width="90"/>
<img src="https://openerz.metaodi.ch/static/logo.png" alt="OpenERZ-Logo" width="90"/>
4 changes: 4 additions & 0 deletions lib/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
};
}
Expand Down

0 comments on commit 7c156b2

Please sign in to comment.