mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-15 19:28:00 +01:00
Exclude blank values from query string in stream producer URL
This commit is contained in:
@@ -423,18 +423,20 @@ fn build_producer_url(
|
||||
env: &HashMap<String, String>,
|
||||
) -> Result<Url> {
|
||||
let mut url: Url = url.parse()?;
|
||||
let term_type = env::var("TERM").ok().unwrap_or_default();
|
||||
let shell = env::var("SHELL").ok().unwrap_or_default();
|
||||
let mut params = Vec::new();
|
||||
|
||||
let mut params = vec![
|
||||
("term[type]".to_string(), term_type.clone()),
|
||||
("shell".to_string(), shell.clone()),
|
||||
];
|
||||
if let Ok(term_type) = env::var("TERM") {
|
||||
params.push(("term[type]".to_string(), term_type));
|
||||
}
|
||||
|
||||
if let Some(version) = term_version {
|
||||
params.push(("term[version]".to_string(), version));
|
||||
}
|
||||
|
||||
if let Ok(shell) = env::var("SHELL") {
|
||||
params.push(("shell".to_string(), shell));
|
||||
}
|
||||
|
||||
for (k, v) in env {
|
||||
params.push((format!("env[{k}]"), v.to_string()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user