Skip to content

Commit

Permalink
feat: support keepalive property for Request object (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
usualoma authored Feb 19, 2024
1 parent 4eb1296 commit ba5166f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const requestPrototype: Record<string | symbol, any> = {
'referrer',
'referrerPolicy',
'signal',
'keepalive',
].forEach((k) => {
Object.defineProperty(requestPrototype, k, {
get() {
Expand Down
1 change: 1 addition & 0 deletions test/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('Request', () => {
expect(req.method).toBe('GET')
expect(req.url).toBe('http://localhost/')
expect(req.headers.get('host')).toBe('localhost')
expect(req.keepalive).toBe(false)
})

it('Should resolve double dots in URL', async () => {
Expand Down

0 comments on commit ba5166f

Please sign in to comment.