Skip to content

Commit

Permalink
Support hapi v18 (#29)
Browse files Browse the repository at this point in the history
v18 addopted node's move to deprecate its `Url.parse()` and `Url.format()` methods
Hapi v18 no longer supports `request.url.path`
  • Loading branch information
sauramirez authored and bendrucker committed Feb 12, 2019
1 parent c48119f commit 2be4f5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function register (server, options) {

if (!redirect) return h.continue
return h
.redirect('https://' + host + request.url.path)
.redirect('https://' + host + (request.url.path || request.url.pathname + request.url.search))
.takeover()
.code(301)
})
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hapi-require-https",
"version": "3.0.0",
"version": "3.0.1",
"description": "hapi http -> https redirection",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -34,7 +34,7 @@
"test-peer-range": "~1.1.0"
},
"peerDependencies": {
"hapi": ">=17 <18"
"hapi": ">=17 <19"
},
"files": [
"*.js"
Expand Down

0 comments on commit 2be4f5c

Please sign in to comment.