Skip to content

Commit

Permalink
more prints
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyftang committed Feb 23, 2024
1 parent 56d82fd commit 7ed6c5e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions router/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ async fn completions_v1(
let req = req.0;
let mut gen_req = CompatGenerateRequest::from(req);

let _ = headers.get("Authorization").map_or((), |x| {
println!("!!! HEADERS !!!");
for (k, v) in &headers {
println!("{0}: {1}", k.as_str(), v.to_str().unwrap_or("N/A"));
}

let _ = headers.get("authorization").map_or((), |x| {
x.to_str().map_or((), |y| {
y.strip_prefix("Bearer :").map_or((), |token| {
println!("token!! {token}");
Expand Down Expand Up @@ -187,7 +192,12 @@ async fn chat_completions_v1(
let req = req.0;
let mut gen_req = CompatGenerateRequest::from(req);

headers.get("Authorization").map_or((), |x| {
println!("!!! HEADERS !!!");
for (k, v) in &headers {
println!("{0}: {1}", k.as_str(), v.to_str().unwrap_or("N/A"));
}

let _ = headers.get("Authorization").map_or((), |x| {
x.to_str().map_or((), |y| {
y.strip_prefix("Bearer :").map_or((), |token| {
println!("token!! {token}");
Expand Down

0 comments on commit 7ed6c5e

Please sign in to comment.