Skip to content

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

Open
@Titoflegit

Description

@Titoflegit

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions