Skip to content

Commit 9550912

Browse files
committed
fix(guard): serialize gateway actor keys correctly
1 parent a05b2e5 commit 9550912

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

engine/packages/guard/src/routing/pegboard_gateway/resolve_actor_query.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ async fn resolve_query_target_dc_label(
208208

209209
fn serialize_actor_key(key: &[String]) -> Result<String> {
210210
const EMPTY_KEY: &str = "/";
211-
const KEY_SEPARATOR: char = '/';
211+
const KEY_SEPARATOR: &str = "/";
212+
const KEY_SEPARATOR_CHAR: char = '/';
212213

213214
if key.is_empty() {
214215
return Ok(EMPTY_KEY.to_string());
@@ -221,11 +222,13 @@ fn serialize_actor_key(key: &[String]) -> Result<String> {
221222
continue;
222223
}
223224

224-
let escaped = part.replace('\\', "\\\\").replace(KEY_SEPARATOR, "\\/");
225+
let escaped = part
226+
.replace('\\', "\\\\")
227+
.replace(KEY_SEPARATOR_CHAR, "\\/");
225228
escaped_parts.push(escaped);
226229
}
227230

228-
Ok(escaped_parts.join(EMPTY_KEY))
231+
Ok(escaped_parts.join(KEY_SEPARATOR))
229232
}
230233

231234
fn is_duplicate_key_error(err: &anyhow::Error) -> bool {

0 commit comments

Comments
 (0)