Skip to content

Commit a830565

Browse files
committed
feat(helpers): bump ecs.version to 1.6.0; do not lowercase http.request.method
1 parent 426102a commit a830565

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed

helpers/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
- Update ECS version to "1.6.0". Relevant [ECS changes](https://github.com/elastic/ecs/blob/master/CHANGELOG.md#160):
6+
- "span.id" - This field is included by the loggers when integrating with APM.
7+
- "Deprecate guidance to lowercase http.request.method."
8+
Now when using `formatHttpRequest` the "http.request.method" field will no
9+
longer be lowercased.
510
- Fix possible crash in `formatHttpRequest` if `req.socket` is not available.
611
([#17](https://github.com/elastic/ecs-logging-nodejs/issues/17))
712
- Add support for the hapi request object being passed to `formatHttpRequest`

helpers/lib/http-formatters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function formatHttpRequest (ecs, req) {
4343
ecs.http = ecs.http || {}
4444
ecs.http.version = httpVersion
4545
ecs.http.request = ecs.http.request || {}
46-
ecs.http.request.method = method.toLowerCase()
46+
ecs.http.request.method = method
4747

4848
ecs.url = ecs.url || {}
4949
ecs.url.full = (socket && socket.encrypted ? 'https://' : 'http://') + headers.host + url

helpers/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const errorFormatters = require('./error-formatters')
2222
const httpFormatters = require('./http-formatters')
2323

2424
module.exports = {
25-
version: '1.5.0',
25+
version: '1.6.0',
2626
stringify,
2727
...errorFormatters,
2828
...httpFormatters

helpers/test/basic.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ test('formatHttpRequest and formatHttpResponse should return a valid ecs object'
161161
t.deepEqual(line.http, {
162162
version: '1.1',
163163
request: {
164-
method: 'post',
164+
method: 'POST',
165165
headers: {
166166
'content-type': 'application/json',
167167
host: `localhost:${server.address().port}`,

helpers/test/express.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ test('express res/req serialization', t => {
5050
t.deepEqual(rec.http, {
5151
version: '1.1',
5252
request: {
53-
method: 'get',
53+
method: 'GET',
5454
headers: {
5555
host: `localhost:${server.address().port}`,
5656
connection: 'close'

helpers/test/hapi.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test('hapi res/req serialization', testOpts, t => {
5959
t.deepEqual(rec.http, {
6060
version: '1.1',
6161
request: {
62-
method: 'get',
62+
method: 'GET',
6363
headers: {
6464
host: `localhost:${server.info.port}`,
6565
connection: 'close'

0 commit comments

Comments
 (0)