feature/upstream-service #13
@@ -1,4 +1,4 @@
|
|||||||
use std::sync::Arc;
|
use std::{os::unix::fs::FileTypeExt, sync::Arc};
|
||||||
|
|
||||||
use agent_client::{
|
use agent_client::{
|
||||||
apis::{
|
apis::{
|
||||||
@@ -105,7 +105,9 @@ impl From<AgentSettings> for Configuration {
|
|||||||
let mut builder = reqwest::Client::builder();
|
let mut builder = reqwest::Client::builder();
|
||||||
|
|
||||||
let url = settings.socket_path;
|
let url = settings.socket_path;
|
||||||
if url.starts_with("unix://") {
|
// check if the url is a unix socket path
|
||||||
|
let is_socket = std::fs::metadata(&url).is_ok_and(|m| m.file_type().is_socket());
|
||||||
|
if is_socket || url.starts_with("unix://") {
|
||||||
builder = builder.unix_socket(url.to_string());
|
builder = builder.unix_socket(url.to_string());
|
||||||
config.client = builder.build().expect("Failed to build reqwest client");
|
config.client = builder.build().expect("Failed to build reqwest client");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user