mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 23:23:28 +00:00
Add an insecure_disable_tls_host_verification command line option
When set, this disables the host verification of all HTTP requests. Available for both the fetch and serve mode. Also introduced an App.Config, for future command line options which need to be passed more deeply into the code.
This commit is contained in:
17
src/app.zig
17
src/app.zig
@@ -17,11 +17,18 @@ pub const App = struct {
|
||||
app_dir_path: ?[]const u8,
|
||||
|
||||
pub const RunMode = enum {
|
||||
serve,
|
||||
help,
|
||||
fetch,
|
||||
serve,
|
||||
version,
|
||||
};
|
||||
|
||||
pub fn init(allocator: Allocator, run_mode: RunMode) !*App {
|
||||
pub const Config = struct {
|
||||
tls_verify_host: bool = true,
|
||||
run_mode: RunMode,
|
||||
};
|
||||
|
||||
pub fn init(allocator: Allocator, config: Config) !*App {
|
||||
const app = try allocator.create(App);
|
||||
errdefer allocator.destroy(app);
|
||||
|
||||
@@ -38,9 +45,11 @@ pub const App = struct {
|
||||
.allocator = allocator,
|
||||
.telemetry = undefined,
|
||||
.app_dir_path = app_dir_path,
|
||||
.http_client = try HttpClient.init(allocator, 5),
|
||||
.http_client = try HttpClient.init(allocator, 5, .{
|
||||
.tls_verify_host = config.tls_verify_host,
|
||||
}),
|
||||
};
|
||||
app.telemetry = Telemetry.init(app, run_mode);
|
||||
app.telemetry = Telemetry.init(app, config.run_mode);
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user