Skip to content

Commit 2355479

Browse files
committed
1. Ran rustfmt
2. Removed empty test mod
1 parent 2f16b18 commit 2355479

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

rsky-pds/src/pipethrough.rs

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::config::{ServerConfig, ServiceConfig};
44
use crate::xrpc_server::types::{HandlerPipeThrough, InvalidRequestError, XRPCError};
55
use crate::{context, SharedIdResolver, APP_USER_AGENT};
66
use anyhow::{bail, Result};
7-
use futures::StreamExt;
87
use lazy_static::lazy_static;
98
use reqwest::header::{HeaderMap, HeaderValue, CONTENT_TYPE};
109
use reqwest::{Client, RequestBuilder, Response};
@@ -13,7 +12,6 @@ use rocket::http::{Method, Status};
1312
use rocket::request::{FromRequest, Outcome, Request};
1413
use rocket::{Data, State};
1514
use rsky_common::{get_service_endpoint, GetServiceEndpointOpts};
16-
use rsky_identity::types::DidDocument;
1715
use rsky_repo::types::Ids;
1816
use serde::de::DeserializeOwned;
1917
use serde_json::Value as JsonValue;
@@ -193,18 +191,17 @@ pub async fn pipethrough_procedure_post<'r>(
193191
let encoded_body: Option<JsonValue>;
194192
match body {
195193
None => encoded_body = None,
196-
Some(mut body) => {
197-
let res;
198-
match body.open(50.megabytes()).into_string().await {
194+
Some(body) => {
195+
let res = match body.open(50.megabytes()).into_string().await {
199196
Ok(res1) => {
200197
tracing::info!(res1.value);
201-
res = res1.value;
198+
res1.value
202199
}
203200
Err(error) => {
204201
tracing::error!("{error}");
205202
return Err(ApiError::RuntimeError);
206203
}
207-
}
204+
};
208205
match serde_json::from_str(res.as_str()) {
209206
Ok(res) => {
210207
encoded_body = Some(res);
@@ -589,7 +586,7 @@ pub fn is_safe_url(url: Url) -> bool {
589586
if url.scheme() != "https" {
590587
return false;
591588
}
592-
return match url.host_str() {
589+
match url.host_str() {
593590
None => false,
594591
Some(hostname) if hostname == "localhost" => false,
595592
Some(hostname) => {
@@ -598,21 +595,5 @@ pub fn is_safe_url(url: Url) -> bool {
598595
}
599596
true
600597
}
601-
};
602-
}
603-
604-
#[cfg(test)]
605-
mod tests {
606-
use super::*;
607-
608-
#[test]
609-
fn test_parse_atproto_proxy_header() {
610-
// let text = "#blacksky? more like #niggersky";
611-
// let result = contains_explicit_slurs(text);
612-
// assert_eq!(
613-
// result, true,
614-
// "Provided text should be flagged, actual: {}",
615-
// result
616-
// );
617598
}
618599
}

0 commit comments

Comments
 (0)