diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index af64e97eb..75c01ff32 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -5,6 +5,7 @@ on: branches: [ "master" ] pull_request: branches: [ "master" ] + workflow_dispatch: env: BUILD_TYPE: Release diff --git a/include/crow/app.h b/include/crow/app.h index 25592da69..7628cfbf8 100644 --- a/include/crow/app.h +++ b/include/crow/app.h @@ -460,8 +460,8 @@ namespace crow } #endif - /// \brief Apply blueprints - void add_blueprint() + /// \brief Apply blueprints static routes + void add_blueprint_static_dirs() { #if defined(__APPLE__) || defined(__MACH__) if (router_.blueprints().empty()) return; @@ -480,9 +480,7 @@ namespace crow res.set_static_file_info_unsafe(static_dir_ + file_path_partial); res.end(); }); - } - - router_.validate_bp(); + } } /// \brief Go through the rules, upgrade them if possible, and add them to the list of rules @@ -503,13 +501,14 @@ namespace crow void validate() { router_.validate(); + router_.validate_bp(); } /// \brief Run the server void run() { #ifndef CROW_DISABLE_STATIC_DIR - add_blueprint(); + add_blueprint_static_dirs(); add_static_dir(); #endif validate(); diff --git a/tests/unittest.cpp b/tests/unittest.cpp index 53f083c07..bcb5f9624 100644 --- a/tests/unittest.cpp +++ b/tests/unittest.cpp @@ -3643,7 +3643,7 @@ TEST_CASE("blueprint") bp.register_blueprint(sub_bp); sub_bp.register_blueprint(sub_sub_bp); - app.add_blueprint(); + app.add_blueprint_static_dirs(); app.add_static_dir(); app.validate();