You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let uri = Uri::from_str(&format!("{}{}",CONFIG.chatgpt_url, path_and_query,)).unwrap();
86
86
println!("uri: {:?}", uri);
87
+
// if req header Authorization is null, set empty
88
+
let authorization = ifletSome(value) = req.headers().get("Authorization"){
89
+
value.to_str().unwrap()
90
+
}else{
91
+
""
92
+
};
93
+
let content_type = ifletSome(value) = req.headers().get("Content-Type"){
94
+
value.to_str().unwrap()
95
+
}else{
96
+
"application/json"
97
+
};
98
+
87
99
let request_builder = Request::builder().method(req.method())
88
100
.uri(uri)
89
101
.header("user-agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.50")
0 commit comments