Share error_response and default host allowlist; drop AppResult
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YShymaPrXmc3KYRUg2HMSs
This commit is contained in:
1 parent
66eb91bf01
commit
d022ebeae5
5 files changed
+38
-60
No files matched your search
+15
-1
@@ -58,6 +58,20 @@ pub struct TlsConfig {
|
||||
pub key_file: PathBuf,
|
||||
}
|
||||
|
||||
impl ServerConfig {
|
||||
/// Host names always accepted: loopback plus `bind` (unless unspecified).
|
||||
pub fn default_hosts(&self) -> Vec<String> {
|
||||
let mut v: Vec<String> = ["localhost", "127.0.0.1", "::1"]
|
||||
.into_iter()
|
||||
.map(String::from)
|
||||
.collect();
|
||||
if !self.bind.is_unspecified() {
|
||||
v.push(self.bind.to_string());
|
||||
}
|
||||
v
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for ServerConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
@@ -138,7 +152,7 @@ pub struct OtelLogsConfig {
|
||||
|
||||
/// Glob allowlists for exported metrics.
|
||||
///
|
||||
/// Empty `units` means `*.service` and `*.timer` (DEC-7). Empty `containers`
|
||||
/// Empty `units` means `*.service` and `*.timer`. Empty `containers`
|
||||
/// means all containers.
|
||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
|
||||
Reference in new issue
Block a user