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

Recursion depth with RegEx when a few more params than 2 #17

Open
Titoflegit opened this issue Feb 18, 2025 · 0 comments
Open

Recursion depth with RegEx when a few more params than 2 #17

Titoflegit opened this issue Feb 18, 2025 · 0 comments

Comments

@Titoflegit
Copy link

Titoflegit commented Feb 18, 2025

File "utils.py", line 140, in get_request_query_params
File "utils.py", line 114, in get_request_query_string
RuntimeError: maximum recursion depth exceeded

I have 15 params.

What works for me is:

def get_request_query_string(request):
    """ return http request query string """
    lines = request.split("\r\n")
    print(lines[0])
    query_str=lines[0].split(' ')
    print(query_str[1])
    if '&' in query_str[1]:
        return query_str[1][2:] #to skip /&
    else:
        return ""

And there is the same problem with POST, but in this case we do not have even the full request and the POST data is trimmed. Do not know how to solve this

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

1 participant