mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Ensure pagination URLs are fully qualified
This commit is contained in:
parent
bc6f2a1703
commit
33a6986462
|
@ -15,7 +15,7 @@ class NextPageField(serializers.Field):
|
|||
return None
|
||||
page = value.next_page_number()
|
||||
request = self.context.get('request')
|
||||
url = request and request.get_full_path() or ''
|
||||
url = request and request.build_absolute_uri() or ''
|
||||
return replace_query_param(url, self.page_field, page)
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@ class PreviousPageField(serializers.Field):
|
|||
return None
|
||||
page = value.previous_page_number()
|
||||
request = self.context.get('request')
|
||||
url = request and request.get_full_path() or ''
|
||||
url = request and request.build_absolute_uri() or ''
|
||||
return replace_query_param(url, self.page_field, page)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user