mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
fix(core): fix sanitize name to use '_' everywhere (#14833)
This commit is contained in:
1 parent
a0e41f4ff9
commit
663dd3f935
2 files changed
+7
-5
No files matched your search
@@ -469,7 +469,7 @@ pub fn connector_display_label(connector: &AppInfo) -> String {
|
||||
}
|
||||
|
||||
pub fn connector_mention_slug(connector: &AppInfo) -> String {
|
||||
sanitize_name(&connector_display_label(connector))
|
||||
sanitize_slug(&connector_display_label(connector))
|
||||
}
|
||||
|
||||
pub(crate) fn accessible_connectors_from_mcp_tools(
|
||||
@@ -918,11 +918,15 @@ fn normalize_connector_value(value: Option<&str>) -> Option<String> {
|
||||
}
|
||||
|
||||
pub fn connector_install_url(name: &str, connector_id: &str) -> String {
|
||||
let slug = sanitize_name(name);
|
||||
let slug = sanitize_slug(name);
|
||||
format!("https://chatgpt.com/apps/{slug}/{connector_id}")
|
||||
}
|
||||
|
||||
pub fn sanitize_name(name: &str) -> String {
|
||||
sanitize_slug(name).replace("-", "_")
|
||||
}
|
||||
|
||||
fn sanitize_slug(name: &str) -> String {
|
||||
let mut normalized = String::with_capacity(name.len());
|
||||
for character in name.chars() {
|
||||
if character.is_ascii_alphanumeric() {
|
||||
|
||||
Reference in new issue
Block a user