Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite recursion in ::Get #878

Closed
fhoenig opened this issue Mar 16, 2021 · 1 comment
Closed

Infinite recursion in ::Get #878

fhoenig opened this issue Mar 16, 2021 · 1 comment

Comments

@fhoenig
Copy link

fhoenig commented Mar 16, 2021

You pass the params back into the same function....

Here is a fix:

inline Result ClientImpl::Get(const char *path, const Params &params,
                              const Headers &headers,
                              ResponseHandler response_handler,
                              ContentReceiver content_receiver,
                              Progress progress)
{
    if (params.empty()) {
        return Get(path, headers, response_handler, content_receiver, progress);
    }
    else
    {
        std::string path_with_query = detail::append_query_params(path, params);
        return Get(path_with_query.c_str(), {}, headers, response_handler,
                   content_receiver, progress);
    }
}

@yhirose
Copy link
Owner

yhirose commented Mar 16, 2021

@fhoenig, thanks for finding the bug!

ExclusiveOrange pushed a commit to ExclusiveOrange/cpp-httplib-exor that referenced this issue May 2, 2023
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

No branches or pull requests

2 participants