Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 7e60d31

Browse files
committed
adding proxy headers test case
1 parent adf29b3 commit 7e60d31

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/1.smoke.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ describe('fast-proxy smoke', () => {
5151
})
5252
service.get('/service/headers', (req, res) => {
5353
res.setHeader('x-agent', 'fast-proxy')
54+
res.setHeader('host', req.headers.host)
55+
res.setHeader('x-forwarded-host', req.headers['x-forwarded-host'])
56+
5457
res.send()
5558
})
5659

@@ -85,6 +88,8 @@ describe('fast-proxy smoke', () => {
8588
.expect(200)
8689
.then((response) => {
8790
expect(response.headers['x-agent']).to.equal('fast-proxy')
91+
expect(response.headers.host).to.equal('127.0.0.1:3000')
92+
expect(response.headers['x-forwarded-host']).to.equal('127.0.0.1:8080')
8893
})
8994
})
9095

0 commit comments

Comments
 (0)