Skip to content

Commit

Permalink
fixing bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Elmer Bulthuis committed Jul 31, 2024
1 parent 7c9e3b3 commit 3b931b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/cargo/jns42-core/src/utils/fetch_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ pub async fn fetch_text(location: &str) -> Result<String, FetchTextError> {
use tokio::io::AsyncReadExt;

if location.starts_with("http://") || location.starts_with("https://") {
let mut response = surf::get(location).await?;
let mut response = surf::get(location)
.middleware(surf::middleware::Redirect::new(5))
.await?;
let data = response.body_string().await?;
Ok(data)
} else {
Expand Down
4 changes: 2 additions & 2 deletions packages/cargo/jns42-core/src/utils/node_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl NodeCache {

match node {
serde_json::Value::Array(array_node) => {
for index in 0..array_node.len() {
for (index, node) in array_node.iter().enumerate() {
let member = index.to_string();
result.push(iter::once(member.clone()).collect());
for pointer in Self::get_child_pointers(node) {
Expand All @@ -148,7 +148,7 @@ impl NodeCache {
}
}
serde_json::Value::Object(object_node) => {
for key in object_node.keys() {
for (key, node) in object_node {
let member = key.to_owned();
result.push(iter::once(member.clone()).collect());
for pointer in Self::get_child_pointers(node) {
Expand Down

0 comments on commit 3b931b4

Please sign in to comment.