Skip to content

Commit

Permalink
Merge 0bb2f73 into 5095f23
Browse files Browse the repository at this point in the history
  • Loading branch information
felixheck committed Jan 7, 2020
2 parents 5095f23 + 0bb2f73 commit 7416d11
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
10
12
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -3,7 +3,6 @@ language: node_js
node_js:
- lts/*
- node
- 10

before_script:
- npm install
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2017 Felix Heck
Copyright (c) 2017-2020 Felix Heck

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -30,6 +30,7 @@ The modules [`standard`](https://standardjs.com/) and [`ava`](https://github.com
#### Compatibility
| Major Release | [hapi.js](https://github.com/hapijs/hapi) version | [hapi-pino](https://github.com/pinojs/hapi-pino) version | node version |
| --- | --- | --- | --- |
| `v6` | `>=18.4 @hapi/hapi` | `>= 6.3` | `>=12` |
| `v5.1` | `>=18.3.1 @hapi/hapi` | `>= 5.4` | `>=8` |
| `v5` | `>=18 hapi` | `>= 5.4` | `>=8` |
| `v4` | `>=17 hapi` | `>= 5.1` | `>=8` |
Expand Down
18 changes: 9 additions & 9 deletions package.json
Expand Up @@ -41,23 +41,23 @@
},
"devDependencies": {
"@hapi/hapi": "^18.4.0",
"ava": "^2.2.0",
"coveralls": "^3.0.5",
"ava": "^2.4.0",
"coveralls": "^3.0.9",
"fixture-stdout": "^0.2.1",
"nyc": "^15.0.0",
"standard": "^14.3.0"
"standard": "^14.3.1"
},
"dependencies": {
"@hapi/joi": "^16.1.1",
"@hapi/joi": "^17.0.0",
"chalk": "^3.0.0",
"error-stack-parser": "^2.0.2",
"hapi-pino": "^6.0.1",
"error-stack-parser": "^2.0.6",
"hapi-pino": "^6.3.0",
"lodash.get": "^4.4.2",
"lodash.set": "^4.3.2",
"pino": "^5.13.0"
"pino": "^5.15.0"
},
"engines": {
"node": ">= 8.9",
"npm": ">= 5.5.1"
"node": ">= 12",
"npm": ">= 6"
}
}
2 changes: 1 addition & 1 deletion src/tokens.js
Expand Up @@ -151,7 +151,7 @@ assign('remotePort', data => (
))

assign('url', data => (
data.req && data.req.url
data.req && data.req.url && data.req.url.href
))

assign('host', (data, colors, field = 'host') => {
Expand Down
6 changes: 4 additions & 2 deletions test/tokens.spec.js
Expand Up @@ -111,7 +111,9 @@ test('return requested req/res attributes', (t) => {
req: {
id: '1499781055994:f3lix:67067:j4zmw7av:10000',
method: 'get',
url: '/',
url: {
href: '/'
},
remoteAddress: '127.0.0.1',
remotePort: 52086,
headers: {
Expand All @@ -126,7 +128,7 @@ test('return requested req/res attributes', (t) => {
t.is(tokens.payload(mockData), JSON.stringify({}))
t.is(tokens.remoteAddress(mockData), mockData.req.remoteAddress)
t.is(tokens.remotePort(mockData), mockData.req.remotePort)
t.is(tokens.url(mockData), mockData.req.url)
t.is(tokens.url(mockData), mockData.req.url.href)
t.is(tokens.req(mockData, mockColors, 'x-header'), mockData.req.headers['x-header'])
t.is(tokens.res(mockData, mockColors, 'foobar'), 'no-cache')
t.is(tokens.res(mockData, mockColors, 'barfoo'), '42')
Expand Down

0 comments on commit 7416d11

Please sign in to comment.