Added Websocket to RequestMode enum

set unreachable in dom/request.rs for websocket

fixed imports
This commit is contained in:
Dowon Cha 2017-01-06 14:32:24 -05:00
parent 6d4ccab2b7
commit 8bf924dc79
3 changed files with 3 additions and 0 deletions

View file

@ -330,6 +330,7 @@ impl CoreResourceManager {
let ua = self.user_agent.clone();
let dc = self.devtools_chan.clone();
let filemanager = self.filemanager.clone();
thread::Builder::new().name(format!("fetch thread for {}", init.url)).spawn(move || {
let request = Request::from_init(init);
// XXXManishearth: Check origin against pipeline id (also ensure that the mode is allowed)

View file

@ -77,6 +77,7 @@ pub enum RequestMode {
SameOrigin,
NoCors,
CorsMode,
WebSocket
}
/// Request [credentials mode](https://fetch.spec.whatwg.org/#concept-request-credentials-mode)

View file

@ -826,6 +826,7 @@ impl Into<RequestMode> for NetTraitsRequestMode {
NetTraitsRequestMode::SameOrigin => RequestMode::Same_origin,
NetTraitsRequestMode::NoCors => RequestMode::No_cors,
NetTraitsRequestMode::CorsMode => RequestMode::Cors,
NetTraitsRequestMode::WebSocket => unreachable!("Websocket request mode should never be exposed to JS"),
}
}
}