From 617b6b8af336c1aadbfc4f98b40c419268f5833f Mon Sep 17 00:00:00 2001 From: Lucas Pickering Date: Sat, 26 Oct 2024 15:06:58 -0400 Subject: [PATCH] Fix ignore_certificate_hosts and large_body_size config fields --- CHANGELOG.md | 4 ++++ crates/config/src/lib.rs | 1 + crates/core/src/http.rs | 1 + docs/src/api/configuration/index.md | 1 + 4 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd263bef..306dd0f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), - Preserve key order of objects in JSON responses [#405](https://github.com/LucasPickering/slumber/issues/405) +### Fixed + +- Fixed `ignore_certificate_hosts` and `large_body_size` fields not being loaded from config + ## [2.2.0] - 2024-10-22 ### Added diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index c5fc01f3..15287b5f 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -42,6 +42,7 @@ pub struct Config { /// Command to use for in-app editing. If provided, overrides /// `VISUAL`/`EDITOR` environment variables pub editor: Option, + #[serde(flatten)] pub http: HttpEngineConfig, /// Should templates be rendered inline in the UI, or should we show the /// raw text? diff --git a/crates/core/src/http.rs b/crates/core/src/http.rs index 2ec18240..64aba82e 100644 --- a/crates/core/src/http.rs +++ b/crates/core/src/http.rs @@ -293,6 +293,7 @@ impl Default for HttpEngine { } #[derive(Debug, Serialize, Deserialize)] +#[serde(default)] pub struct HttpEngineConfig { /// TLS cert errors on these hostnames are ignored. Be careful! pub ignore_certificate_hosts: Vec, diff --git a/docs/src/api/configuration/index.md b/docs/src/api/configuration/index.md index 2712a537..a642eb44 100644 --- a/docs/src/api/configuration/index.md +++ b/docs/src/api/configuration/index.md @@ -36,5 +36,6 @@ SLUMBER_CONFIG_PATH=~/dotfiles/slumber.yml slumber | `editor` | `string` | Command to use when opening files for in-app editing. [More info](./editor.md) | `VISUAL`/`EDITOR` env vars | | `ignore_certificate_hosts` | `string[]` | Hostnames whose TLS certificate errors will be ignored. [More info](../../troubleshooting/tls.md) | `[]` | | `input_bindings` | `mapping[Action, KeyCombination[]]` | Override default input bindings. [More info](./input_bindings.md) | `{}` | +| `large_body_size` | `number` | Size over which request/response bodies are not formatted/highlighted, for performance (bytes) | `1000000` (1 MB) | | `preview_templates` | `boolean` | Render template values in the TUI? If false, the raw template will be shown. | `true` | | `theme` | [`Theme`](./theme.md) | Visual customizations | `{}` |