diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-18 00:31:24 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-18 00:31:24 +0530 |
commit | 0008c07dc343d911be042516b32c994fc18e3900 (patch) | |
tree | 142500f5f294807fd61f3f2226cb1d49ff5b94c4 /components/script/dom | |
parent | 7a9dc577617b442ff0fe07eaa683207234c519ee (diff) | |
parent | 4ddf4e7bdcde769265acd23fa9dea28d2a05bb57 (diff) | |
download | servo-0008c07dc343d911be042516b32c994fc18e3900.tar.gz servo-0008c07dc343d911be042516b32c994fc18e3900.zip |
Auto merge of #10014 - saurvs:pr1, r=KiChjang
Update WebSocket blocked ports to match the Fetch spec
Adresses #9949.
This adds a function that tests whether a request should be blocked or not based on it's url's scheme and port. It also adds testing for port restriction to the `main_fetch` method. More info in https://github.com/whatwg/fetch/commit/eb07418c8383983a9887498e49a2e2e986d3c9f4.
@Ms2ger In https://github.com/whatwg/html/issues/841, @annevk proposes to remove port restrictions from websockets. Should we go ahead do that, given that the spec hasn't been changed yet?
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10014)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/websocket.rs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs index a6d9d9ae358..e2a29229efc 100644 --- a/components/script/dom/websocket.rs +++ b/components/script/dom/websocket.rs @@ -55,8 +55,8 @@ enum WebSocketRequestState { Closed = 3, } -// list of blacklist ports according to -// http://mxr.mozilla.org/mozilla-central/source/netwerk/base/nsIOService.cpp#87 +// list of bad ports according to +// https://fetch.spec.whatwg.org/#port-blocking const BLOCKED_PORTS_LIST: &'static [u16] = &[ 1, // tcpmux 7, // echo @@ -67,7 +67,7 @@ const BLOCKED_PORTS_LIST: &'static [u16] = &[ 17, // qotd 19, // chargen 20, // ftp-data - 21, // ftp-cntl + 21, // ftp 22, // ssh 23, // telnet 25, // smtp @@ -90,11 +90,11 @@ const BLOCKED_PORTS_LIST: &'static [u16] = &[ 115, // sftp 117, // uucp-path 119, // nntp - 123, // NTP + 123, // ntp 135, // loc-srv / epmap 139, // netbios 143, // imap2 - 179, // BGP + 179, // bgp 389, // ldap 465, // smtp+ssl 512, // print / exec @@ -103,19 +103,25 @@ const BLOCKED_PORTS_LIST: &'static [u16] = &[ 515, // printer 526, // tempo 530, // courier - 531, // Chat + 531, // chat 532, // netnews 540, // uucp 556, // remotefs 563, // nntp+ssl - 587, // - 601, // + 587, // smtp + 601, // syslog-conn 636, // ldap+ssl 993, // imap+ssl 995, // pop3+ssl 2049, // nfs + 3659, // apple-sasl 4045, // lockd 6000, // x11 + 6665, // irc (alternate) + 6666, // irc (alternate) + 6667, // irc (default) + 6668, // irc (alternate) + 6669, // irc (alternate) ]; // Close codes defined in https://tools.ietf.org/html/rfc6455#section-7.4.1 |