mirror of
https://github.com/servo/servo.git
synced 2025-07-23 23:33:43 +01:00
Add port blocking for tftp, netbios-ns, snmp, rtsp, h323gatestat, h323hostcall, pptp, sane-port
Spec update: https://github.com/whatwg/fetch/pull/1148
This commit is contained in:
parent
b3ea7db4eb
commit
2e7be21ee1
2 changed files with 6 additions and 101 deletions
|
@ -948,11 +948,12 @@ fn is_network_scheme(scheme: &str) -> bool {
|
|||
|
||||
/// <https://fetch.spec.whatwg.org/#bad-port>
|
||||
fn is_bad_port(port: u16) -> bool {
|
||||
static BAD_PORTS: [u16; 69] = [
|
||||
1, 7, 9, 11, 13, 15, 17, 19, 20, 21, 22, 23, 25, 37, 42, 43, 53, 77, 79, 87, 95, 101, 102,
|
||||
103, 104, 109, 110, 111, 113, 115, 117, 119, 123, 135, 139, 143, 179, 389, 427, 465, 512,
|
||||
513, 514, 515, 526, 530, 531, 532, 540, 548, 556, 563, 587, 601, 636, 993, 995, 2049, 3659,
|
||||
4045, 5060, 5061, 6000, 6665, 6666, 6667, 6668, 6669, 6697,
|
||||
static BAD_PORTS: [u16; 77] = [
|
||||
1, 7, 9, 11, 13, 15, 17, 19, 20, 21, 22, 23, 25, 37, 42, 43, 53, 69, 77, 79, 87, 95, 101,
|
||||
102, 103, 104, 109, 110, 111, 113, 115, 117, 119, 123, 135, 137, 139, 143, 161, 179, 389,
|
||||
427, 465, 512, 513, 514, 515, 526, 530, 531, 532, 540, 548, 554, 556, 563, 587, 601, 636,
|
||||
993, 995, 1719, 1720, 1723, 2049, 3659, 4045, 5060, 5061, 6000, 6566, 6665, 6666, 6667,
|
||||
6668, 6669, 6697,
|
||||
];
|
||||
|
||||
BAD_PORTS.binary_search(&port).is_ok()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue