{"action":"created","issue":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/4260","repository_url":"https://api.github.com/repos/tomchristie/django-rest-framework","labels_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/4260/labels{/name}","comments_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/4260/comments","events_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/4260/events","html_url":"https://github.com/tomchristie/django-rest-framework/pull/4260","id":165372055,"number":4260,"title":"Don't strip empty query params when paginating","user":{"login":"npars","id":1280422,"avatar_url":"https://avatars.githubusercontent.com/u/1280422?v=3","gravatar_id":"","url":"https://api.github.com/users/npars","html_url":"https://github.com/npars","followers_url":"https://api.github.com/users/npars/followers","following_url":"https://api.github.com/users/npars/following{/other_user}","gists_url":"https://api.github.com/users/npars/gists{/gist_id}","starred_url":"https://api.github.com/users/npars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npars/subscriptions","organizations_url":"https://api.github.com/users/npars/orgs","repos_url":"https://api.github.com/users/npars/repos","events_url":"https://api.github.com/users/npars/events{/privacy}","received_events_url":"https://api.github.com/users/npars/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-13T17:04:02Z","updated_at":"2016-07-14T12:25:13Z","closed_at":"2016-07-14T10:07:21Z","pull_request":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/pulls/4260","html_url":"https://github.com/tomchristie/django-rest-framework/pull/4260","diff_url":"https://github.com/tomchristie/django-rest-framework/pull/4260.diff","patch_url":"https://github.com/tomchristie/django-rest-framework/pull/4260.patch"},"body":"## Description\r\n\r\nFixes issue with pagination when the url contains empty query params. The previous implementation would strip out any empty query params from the `next` and `previous` urls. This PR fixes the query parsing and ensures that empty query params are preserved.\r\n\r\nThis possibly fixes #3328."},"comment":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/comments/232650706","html_url":"https://github.com/tomchristie/django-rest-framework/pull/4260#issuecomment-232650706","issue_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/4260","id":232650706,"user":{"login":"npars","id":1280422,"avatar_url":"https://avatars.githubusercontent.com/u/1280422?v=3","gravatar_id":"","url":"https://api.github.com/users/npars","html_url":"https://github.com/npars","followers_url":"https://api.github.com/users/npars/followers","following_url":"https://api.github.com/users/npars/following{/other_user}","gists_url":"https://api.github.com/users/npars/gists{/gist_id}","starred_url":"https://api.github.com/users/npars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npars/subscriptions","organizations_url":"https://api.github.com/users/npars/orgs","repos_url":"https://api.github.com/users/npars/repos","events_url":"https://api.github.com/users/npars/events{/privacy}","received_events_url":"https://api.github.com/users/npars/received_events","type":"User","site_admin":false},"created_at":"2016-07-14T12:25:12Z","updated_at":"2016-07-14T12:25:12Z","body":"The `request` object received by the `View` treats empty query params and missing query params differently:\r\n\r\nGET http://testserver/?filter=\r\n```\r\n(Pdb) repr(request.query_params.get('filter'))\r\n\"u''\"\r\n```\r\n\r\nGET http://testserver/\r\n```\r\n(Pdb) repr(request.query_params.get('filter'))\r\n'None'\r\n```\r\n\r\nThis means that when paginating the next and previous pages could contain a completely different data set from the current query if the API is relying on this behaviour.\r\n\r\nWe currently have an implementation that uses this behaviour for passing search strings into the API. An empty search string is considered valid and returns different results than when the search param is not provided at all. As a result of this only the first page from DRF is valid, all subsequent pages contain the incorrect dataset."}}
{"actor":{"display_login":"npars"}}