Skip to content

catchall_route does not have headers and middlewares impl #1067

@whyjp

Description

@whyjp

I'm using catchall_route to implement dynamic path callbacks (even if it differs from the intended purpose, I think it's a very good feature and API state). Could this functionality be implemented? I'd like middleware / headers (or any features that exist in regular routes but not in catchall) to work with the same functionality as routes.

app.catchall_route()
		([this](const crow::request& req, crow::response& res) {
printf("[CatchAll] URL: %s\n", req.url.c_str());
        printf("[CatchAll] Headers count: %zu\n", req.headers.size());
        for (const auto& header : req.headers) {
            printf("[CatchAll] Header: %s = %s\n", header.first.c_str(), header.second.c_str());
        }

headers count is always 0

crow version 1.2.1-2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions