-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use ipaddrjs deno lib instead of esm.sh
- Loading branch information
v1rtl
committed
Aug 3, 2023
1 parent
39f2c9b
commit 1a34915
Showing
6 changed files
with
60 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/// <reference types="./ipaddr.d.ts" /> | ||
export type { RequestWithConnection } from 'https://deno.land/x/[email protected]/mod.ts' | ||
export { forwarded } from 'https://deno.land/x/[email protected]/mod.ts' | ||
export { | ||
IPv4, | ||
IPv6, | ||
isValid, | ||
parse, | ||
} from "https://esm.sh/[email protected]/lib/ipaddr.js?exports=isValid,parse"; | ||
export type { IPv4, IPv6 } from "./ipaddr.d.ts"; | ||
export type { RequestWithConnection } from "https://deno.land/x/[email protected]/mod.ts"; | ||
export { forwarded } from "https://deno.land/x/[email protected]/mod.ts"; | ||
} from 'https://deno.land/x/[email protected]/mod.ts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,21 +5,22 @@ import { | |
run, | ||
} from 'https://deno.land/x/[email protected]/mod.ts' | ||
import { all, RequestWithConnection } from './mod.ts' | ||
import { ConnInfo } from 'https://deno.land/std@0.192.0/http/server.ts' | ||
import { ConnInfo } from 'https://deno.land/std@0.197.0/http/server.ts' | ||
|
||
const createReq = ( | ||
hostname: string, | ||
headers?: Record<string, string>, | ||
): RequestWithConnection => ({ | ||
conn: { | ||
remoteAddr: { | ||
hostname, | ||
port: 8081, | ||
transport: 'tcp', | ||
}, | ||
} as ConnInfo, | ||
headers: new Headers(headers || {}), | ||
} as unknown as RequestWithConnection) | ||
headers?: Record<string, string> | ||
): RequestWithConnection => | ||
({ | ||
conn: { | ||
remoteAddr: { | ||
hostname, | ||
port: 8081, | ||
transport: 'tcp', | ||
}, | ||
} as ConnInfo, | ||
headers: new Headers(headers || {}), | ||
} as unknown as RequestWithConnection) | ||
|
||
describe('all(req, trust)', () => { | ||
it('with no headers should return socket address', () => { | ||
|