Skip to content

Double encoding url rejection #294

@timed0

Description

@timed0

Hey, I am running pyrebase on python 2.7 (my bad!) but I thought that this might interest you anyway. It's possible the urlencoding/requests package behave differently on python3.

Today my requests to firebase began to be rejected for double-quoting of the query string. I guess this is a change on their end which is why I bring it up here.

the request from build_request_url:

http://..firebase./path.json?orderBy=%2522progress%2522&equalTo=0

you can see the " is encoded to %22 and then to %2522.
I replaced the urlencode of parameters wth an unencoded parameters string and it's better:

parameters_string = '&'.join('{0}={1}'.format(k,v) for k,v in parameters.iteritems())
request_ref = '{0}{1}.json?{2}'.format(self.database_url, self.path, parameters_string)

Maybe I should have just removed the quote() of the string parameter...

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