Skip to content

Commit c5b9edd

Browse files
committed
cargo fmt
Signed-off-by: benwis <[email protected]>
1 parent eb6d837 commit c5b9edd

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/lib.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use anyhow::{anyhow, Context, Result};
22
use futures::SinkExt;
33
use http::{
44
header::{ACCEPT_ENCODING, CACHE_CONTROL, CONTENT_ENCODING, CONTENT_TYPE, ETAG, IF_NONE_MATCH},
5-
HeaderName, StatusCode,Uri,
5+
HeaderName, StatusCode, Uri,
66
};
77
use spin_sdk::http::{Fields, IncomingRequest, OutgoingResponse, ResponseOutparam};
88
use std::{
@@ -100,9 +100,15 @@ async fn handle_request(req: IncomingRequest, res_out: ResponseOutparam) {
100100
.find_map(|(k, v)| (k.to_lowercase() == COMPONENT_ROUTE_HEADER).then_some(v))
101101
.expect("COMPONENT_ROUTE header must be set by the Spin runtime");
102102

103-
let uri = req.uri().parse::<Uri>().expect("URI is invalid").path().as_bytes().to_vec();
104-
if &uri == component_route && path.is_empty(){
105-
path = &uri;
103+
let uri = req
104+
.uri()
105+
.parse::<Uri>()
106+
.expect("URI is invalid")
107+
.path()
108+
.as_bytes()
109+
.to_vec();
110+
if &uri == component_route && path.is_empty() {
111+
path = &uri;
106112
}
107113

108114
let if_none_match = headers

0 commit comments

Comments
 (0)