-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
Hello,
Thanks for this amazing crate.
I have an error when proxying ttyd : "backend tried to switch to protocol Some("WebSocket") when Some("websocket") was requested"... It would seems that converting all to lowercase like this :
fn get_upgrade_type(headers: &HeaderMap) -> Option<String> {
if headers
.get(&*CONNECTION_HEADER)
.map(|value| {
value
.to_str()
.unwrap()
.split(',')
.any(|e| e.trim().to_lowercase() == "upgrade")
})
.unwrap_or(false)
{
if let Some(upgrade_value) = headers.get(&*UPGRADE_HEADER) {
debug!(
"Found upgrade header with value: {}",
upgrade_value.to_str().unwrap().to_owned()
);
return Some(upgrade_value.to_str().unwrap().to_lowercase().to_owned());
}
}
None
}would do the trick.
If it is OK for you I can make a PR, or let you change it directly, as convenient for you.
Best regards.
matthiasg
Metadata
Metadata
Assignees
Labels
No labels