Skip to content

Websocket connection is not integrated into main fetch implementation #35028

@jdm

Description

@jdm

I discovered this while trying to figure out why #34986 was not passing tests involving websockets. Servo's websocket network integration diverges immediately from the normal Fetch implementation in

} => self.resource_manager.websocket_connect(
. This means we duplicate logic about HSTS upgrades, blocked ports, etc. in
// https://fetch.spec.whatwg.org/#websocket-opening-handshake
http_state
.hsts_list
.read()
.unwrap()
.apply_hsts_rules(&mut req_builder.url);
let req_url = req_builder.url.clone();
if should_be_blocked_due_to_bad_port(&req_url) {
return Err("Port blocked".to_string());
}
and miss out on changes to the base Fetch implementation.

We should update our integration to follow https://websockets.spec.whatwg.org/#concept-websocket-establish and only enter websocket-specific code in https://fetch.spec.whatwg.org/#http-network-fetch .

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions