Skip to content
Myr

conninfo.test.ts

This file

Path

src/adapter/cloudflare-workers/conninfo.test.ts

19 lines · 492 bytes · TypeScript

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than f0b094d point at it.

Merge commit from forkYusuke Wadabefore adoptionf0b094d

lines 1–19why, one step back
1import { Context } from '../../context'
2import { getConnInfo } from './conninfo'34describe('getConnInfo', () => {5 it('Should getConnInfo works', () => {6 const address = Math.random().toString()7 const req = new Request('http://localhost/', {8 headers: {9 'cf-connecting-ip': address,10 },11 })12 const c = new Context(req)1314 const info = getConnInfo(c)1516 expect(info.remote.address).toBe(address)17 expect(info.remote.addressType).toBeUndefined()18 })19})