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
refactor: consolidate the ~65-field webserver config into one struct
The full builder configuration previously existed as ~65 parallel data
members duplicated across three places: the create_webserver builder's
_x fields, an identical const-member block on webserver, and a ~77-line
member-initialiser copy in webserver.cpp. Adding one option meant editing
4+ sites.
Introduce `struct webserver_config` (in create_webserver.hpp) holding
every builder input. The builder owns one and its setters mutate it; the
webserver constructor copies it wholesale (`config(params._config)`).
Adding an option is now one struct field + one builder setter.
Mechanical consequences:
- create_webserver setters: _field -> _config.field.
- webserver: ~65 const members -> `const webserver_config config;`
plus the one derived member (auth_skip_paths_normalized), which is
computed at construction and so stays separate.
- webserver.cpp ctor: 77-line init list -> config copy + derived field.
- all read sites: parent->field / ws->field / dws->field ->
...->config.field; webserver's own methods: bare field -> config.field.
- create_webserver::basic_auth_default / digest_auth_default statics ->
detail::default_basic_auth_enabled / default_digest_auth_enabled free
functions (needed before create_webserver is defined).
Net -115 lines. No behavior change: build green, full suite 109/109.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments