Skip to content

fix(app): keep blueprints when CROW_DISABLE_STATIC_DIR is set (#941) - #1221

Open
soniafergusonship wants to merge 1 commit into
CrowCpp:masterfrom
soniafergusonship:fix/disable-static-dir-blueprints-941
Open

fix(app): keep blueprints when CROW_DISABLE_STATIC_DIR is set (#941)#1221
soniafergusonship wants to merge 1 commit into
CrowCpp:masterfrom
soniafergusonship:fix/disable-static-dir-blueprints-941

Conversation

@soniafergusonship

Copy link
Copy Markdown

Summary

CROW_DISABLE_STATIC_DIR gated both add_blueprint() and add_static_dir(), so blueprint routes were never registered (router_.validate_bp() never ran).

This moves blueprint validation into Crow::validate() so blueprints stay active when the static-directory define is set. Global/blueprint static file routes remain behind CROW_DISABLE_STATIC_DIR.

Test plan

  • Build with CROW_DISABLE_STATIC_DIR and run examples/example_blueprint.cpp — blueprint routes respond
  • app.debug_print() shows blueprint routes when the define is set
  • Without the define, default /static/ behavior is unchanged
  • Existing blueprint unit test still passes

Fixes #941

…p#941)

Signed-off-by: soniafergusonship <soniafergusonship@users.noreply.github.com>
@gittiver

Copy link
Copy Markdown
Member

shoudn't this be added to the initial PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting CROW_DISABLE_STATIC_DIR disables the blueprint paths all together

2 participants