Skip to content

Commit fae1c9f

Browse files
committed
Merge branch 'master' of github.com:joeledwards/node-httpbin
2 parents 4e349aa + f175388 commit fae1c9f

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

lib/server.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,16 @@ function server (options = {}) {
4747
const delay = Number(query.delay) || 0
4848

4949
const respond = () => {
50-
res.status(status).json({
51-
method,
52-
path,
53-
headers,
54-
query,
55-
body
56-
})
50+
res
51+
.append('x-client-ip', req.ip)
52+
.status(status)
53+
.json({
54+
method,
55+
path,
56+
headers,
57+
query,
58+
body
59+
})
5760
}
5861

5962
if (delay > 0) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@buzuli/httpbin",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"description": "HTTP testing server",
55
"bin": {
66
"httpbin": "./bin/httpbin.js"

0 commit comments

Comments
 (0)