Skip to content

Commit

Permalink
fix find with special character
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongFuze committed Mar 18, 2024
1 parent 63b4079 commit 86317ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/tigergraph/vertex/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,20 +594,21 @@ impl Identity {
identity: &str,
) -> Result<Option<IdentityRecord>, Error> {
// Builtins: http://server:9000/graph/{GraphName}/vertices/{VertexName}/filter=field1="a",field2="b"
let encoded_identity = urlencoding::encode(identity);
let uri: http::Uri = format!(
"{}/graph/{}/vertices/{}?filter=platform=%22{}%22,identity=%22{}%22",
C.tdb.host,
Graph::SocialGraph.to_string(),
VERTEX_NAME,
platform.to_string(),
identity.to_string(),
encoded_identity,
)
.parse()
.map_err(|_err: InvalidUri| {
Error::ParamError(format!(
"QUERY filter=platform=%22{}%22,identity=%22{}%22 Uri format Error | {}",
platform.to_string(),
identity.to_string(),
encoded_identity,
_err
))
})?;
Expand All @@ -622,7 +623,7 @@ impl Identity {
Error::ManualHttpClientError(format!(
"query filter=platform=%22{}%22,identity=%22{}%22 error | Fail to request: {:?}",
platform.to_string(),
identity.to_string(),
encoded_identity,
err.to_string()
))
})?;
Expand Down
2 changes: 1 addition & 1 deletion src/upstream/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async fn test_fetch_all_ens() -> Result<(), Error> {
Chain::Ethereum,
ContractCategory::ENS,
ContractCategory::ENS.default_contract_address().unwrap(),
"yisiliu.eth".to_string(),
"аррӏе.eth".to_string(),
)],
Some(3),
)
Expand Down

0 comments on commit 86317ca

Please sign in to comment.